@nx/esbuild 19.8.2 → 19.8.4
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/esbuild",
|
3
|
-
"version": "19.8.
|
3
|
+
"version": "19.8.4",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Nx Plugin for esbuild contains executors and generators that support building applications using esbuild",
|
6
6
|
"repository": {
|
@@ -31,14 +31,13 @@
|
|
31
31
|
"migrations": "./migrations.json"
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
|
-
"@nx/devkit": "19.8.
|
35
|
-
"@nx/js": "19.8.
|
34
|
+
"@nx/devkit": "19.8.4",
|
35
|
+
"@nx/js": "19.8.4",
|
36
36
|
"fast-glob": "3.2.7",
|
37
|
-
"fs-extra": "^11.1.0",
|
38
37
|
"picocolors": "^1.1.0",
|
39
38
|
"tsconfig-paths": "^4.1.2",
|
40
39
|
"tslib": "^2.3.0",
|
41
|
-
"@nrwl/esbuild": "19.8.
|
40
|
+
"@nrwl/esbuild": "19.8.4"
|
42
41
|
},
|
43
42
|
"peerDependencies": {
|
44
43
|
"esbuild": "~0.19.2"
|
@@ -6,10 +6,10 @@ const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const js_1 = require("@nx/js");
|
7
7
|
const esbuild = require("esbuild");
|
8
8
|
const normalize_1 = require("./lib/normalize");
|
9
|
-
const fs_extra_1 = require("fs-extra");
|
10
9
|
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
11
10
|
const build_esbuild_options_1 = require("./lib/build-esbuild-options");
|
12
11
|
const get_extra_dependencies_1 = require("./lib/get-extra-dependencies");
|
12
|
+
const node_fs_1 = require("node:fs");
|
13
13
|
const path_1 = require("path");
|
14
14
|
const BUILD_WATCH_FAILED = `[ ${pc.red('watch')} ] build finished with errors (see above), watching for changes...`;
|
15
15
|
const BUILD_WATCH_SUCCEEDED = `[ ${pc.green('watch')} ] build succeeded, watching for changes...`;
|
@@ -17,7 +17,7 @@ async function* esbuildExecutor(_options, context) {
|
|
17
17
|
process.env.NODE_ENV ??= context.configurationName ?? 'production';
|
18
18
|
const options = (0, normalize_1.normalizeOptions)(_options, context);
|
19
19
|
if (options.deleteOutputPath)
|
20
|
-
(0,
|
20
|
+
(0, node_fs_1.rmSync)(options.outputPath, { recursive: true, force: true });
|
21
21
|
const assetsResult = await (0, js_1.copyAssets)(options, context);
|
22
22
|
const externalDependencies = options.external.reduce((acc, name) => {
|
23
23
|
const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
|
@@ -29,7 +29,6 @@ async function* esbuildExecutor(_options, context) {
|
|
29
29
|
});
|
30
30
|
}
|
31
31
|
return acc;
|
32
|
-
return acc;
|
33
32
|
}, []);
|
34
33
|
if (!options.thirdParty) {
|
35
34
|
const thirdPartyDependencies = (0, get_extra_dependencies_1.getExtraDependencies)(context.projectName, context.projectGraph);
|
@@ -131,7 +130,7 @@ async function* esbuildExecutor(_options, context) {
|
|
131
130
|
const filename = options.format.length === 1
|
132
131
|
? 'meta.json'
|
133
132
|
: `meta.${options.format[i]}.json`;
|
134
|
-
(0,
|
133
|
+
(0, devkit_1.writeJsonFile)((0, devkit_1.joinPathFragments)(options.outputPath, filename), buildResult.metafile);
|
135
134
|
}
|
136
135
|
yield {
|
137
136
|
success: buildResult.errors.length === 0,
|
package/src/utils/fs.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.deleteOutputDir = deleteOutputDir;
|
4
4
|
const path = require("path");
|
5
|
-
const
|
5
|
+
const node_fs_1 = require("node:fs");
|
6
6
|
/**
|
7
7
|
* Delete an output directory, but error out if it's the root of the project.
|
8
8
|
*/
|
@@ -11,5 +11,5 @@ function deleteOutputDir(root, outputPath) {
|
|
11
11
|
if (resolvedOutputPath === root) {
|
12
12
|
throw new Error('Output path MUST not be project root directory!');
|
13
13
|
}
|
14
|
-
(0,
|
14
|
+
(0, node_fs_1.rmSync)(resolvedOutputPath, { recursive: true, force: true });
|
15
15
|
}
|