aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorTimmy Willison <timmywil@users.noreply.github.com>2024-03-08 18:18:24 -0500
committerTimmy Willison <timmywil@users.noreply.github.com>2024-03-09 10:36:47 -0500
commit5aa7ed888ddf314fba3c4f8750b891cb6427c9c2 (patch)
tree33bed551762397ac376da1ca2d458c3f2e88e883 /build
parent0293d3e30dd68bfe92be1d6d29f9b9200d1ae917 (diff)
downloadjquery-5aa7ed888ddf314fba3c4f8750b891cb6427c9c2.tar.gz
jquery-5aa7ed888ddf314fba3c4f8750b891cb6427c9c2.zip
Build: drop support for Node 10
Close gh-5436
Diffstat (limited to 'build')
-rw-r--r--build/tasks/build.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js
index c169ce925..5ed1b9c32 100644
--- a/build/tasks/build.js
+++ b/build/tasks/build.js
@@ -6,10 +6,10 @@
"use strict";
-const fs = require( "fs" );
-const path = require( "path" );
-const util = require( "util" );
-const exec = util.promisify( require( "child_process" ).exec );
+const fs = require( "node:fs/promises" );
+const path = require( "node:path" );
+const util = require( "node:util" );
+const exec = util.promisify( require( "node:child_process" ).exec );
const rollup = require( "rollup" );
const excludedFromSlim = require( "./lib/slim-exclude" );
const rollupFileOverrides = require( "./lib/rollup-plugin-file-overrides" );
@@ -38,7 +38,7 @@ const removeWith = {
};
async function read( filename ) {
- return fs.promises.readFile( path.join( srcFolder, filename ), "utf8" );
+ return fs.readFile( path.join( srcFolder, filename ), "utf8" );
}
// Remove the src folder and file extension
@@ -54,7 +54,7 @@ function moduleName( filename ) {
async function readdirRecursive( dir, all = [] ) {
let files;
try {
- files = await fs.promises.readdir( path.join( srcFolder, dir ), {
+ files = await fs.readdir( path.join( srcFolder, dir ), {
withFileTypes: true
} );
} catch ( e ) {
@@ -151,7 +151,7 @@ async function writeCompiled( { code, dir, filename, version } ) {
// yyyy-mm-ddThh:mmZ
.replace( /@DATE/g, new Date().toISOString().replace( /:\d+\.\d+Z$/, "Z" ) );
- await fs.promises.writeFile( path.join( dir, filename ), compiledContents );
+ await fs.writeFile( path.join( dir, filename ), compiledContents );
console.log( `[${ getTimestamp() }] ${ filename } v${ version } created.` );
}
@@ -194,7 +194,7 @@ async function build( {
version += "+slim";
}
- await fs.promises.mkdir( dir, { recursive: true } );
+ await fs.mkdir( dir, { recursive: true } );
// Exclude slim modules when slim is true
const [ excluded, included ] = await checkExclude(
@@ -343,7 +343,7 @@ async function build( {
// We normally process for dist during minification to save
// file reads. However, some files are not minified and then
// we need to do it separately.
- const contents = await fs.promises.readFile(
+ const contents = await fs.readFile(
path.join( dir, filename ),
"utf8"
);