aboutsummaryrefslogtreecommitdiffstats
path: root/build/tasks/minify.js
diff options
context:
space:
mode:
authorTimmy Willison <timmywil@users.noreply.github.com>2024-03-10 12:19:15 -0400
committerTimmy Willison <timmywil@users.noreply.github.com>2024-03-11 13:29:23 -0400
commitae7f6139cc8e21a7116e8de30d26ca38426bde0b (patch)
tree9d7c99074630664a4fd7ceb471ac77ca26287633 /build/tasks/minify.js
parent822362e6efae90610d7289b46477c7fa22758141 (diff)
downloadjquery-ae7f6139cc8e21a7116e8de30d26ca38426bde0b.tar.gz
jquery-ae7f6139cc8e21a7116e8de30d26ca38426bde0b.zip
Build: migrate more uses of fs.promises; use node: protocol
Ref gh-5440
Diffstat (limited to 'build/tasks/minify.js')
-rw-r--r--build/tasks/minify.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/build/tasks/minify.js b/build/tasks/minify.js
index 9aacc31e8..8c536c1ef 100644
--- a/build/tasks/minify.js
+++ b/build/tasks/minify.js
@@ -1,15 +1,15 @@
"use strict";
const swc = require( "@swc/core" );
-const fs = require( "fs" );
-const path = require( "path" );
+const fs = require( "node:fs/promises" );
+const path = require( "node:path" );
const processForDist = require( "./dist" );
const getTimestamp = require( "./lib/getTimestamp" );
const rjs = /\.js$/;
module.exports = async function minify( { filename, dir, esm } ) {
- const contents = await fs.promises.readFile( path.join( dir, filename ), "utf8" );
+ const contents = await fs.readFile( path.join( dir, filename ), "utf8" );
const version = /jQuery JavaScript Library ([^\n]+)/.exec( contents )[ 1 ];
const { code, map: incompleteMap } = await swc.minify(
@@ -48,11 +48,11 @@ module.exports = async function minify( { filename, dir, esm } ) {
} );
await Promise.all( [
- fs.promises.writeFile(
+ fs.writeFile(
path.join( dir, minFilename ),
code
),
- fs.promises.writeFile(
+ fs.writeFile(
path.join( dir, mapFilename ),
map
)