@nx/esbuild 23.1.0 → 23.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,7 +16,7 @@ const BUILD_WATCH_FAILED = `[ ${pc.red('watch')} ] build finished with errors (s
|
|
|
16
16
|
const BUILD_WATCH_SUCCEEDED = `[ ${pc.green('watch')} ] build succeeded, watching for changes...`;
|
|
17
17
|
async function* esbuildExecutor(_options, context) {
|
|
18
18
|
process.env.NODE_ENV ??= context.configurationName ?? 'production';
|
|
19
|
-
const options = (0, normalize_1.normalizeOptions)(_options, context);
|
|
19
|
+
const options = await (0, normalize_1.normalizeOptions)(_options, context);
|
|
20
20
|
if (options.deleteOutputPath)
|
|
21
21
|
(0, node_fs_1.rmSync)(options.outputPath, { recursive: true, force: true });
|
|
22
22
|
const assetsResult = await (0, js_1.copyAssets)(options, context);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ExecutorContext } from '@nx/devkit';
|
|
2
2
|
import type { EsBuildExecutorOptions, NormalizedEsBuildExecutorOptions } from '../schema';
|
|
3
|
-
export declare function normalizeOptions(options: EsBuildExecutorOptions, context: ExecutorContext): NormalizedEsBuildExecutorOptions
|
|
3
|
+
export declare function normalizeOptions(options: EsBuildExecutorOptions, context: ExecutorContext): Promise<NormalizedEsBuildExecutorOptions>;
|
|
@@ -3,13 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
7
|
const js_1 = require("@nx/js");
|
|
7
|
-
const
|
|
8
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
9
|
const fs = tslib_1.__importStar(require("fs"));
|
|
9
10
|
const path = tslib_1.__importStar(require("path"));
|
|
10
11
|
const pc = tslib_1.__importStar(require("picocolors"));
|
|
11
|
-
function normalizeOptions(options, context) {
|
|
12
|
-
const isTsSolutionSetup = (0,
|
|
12
|
+
async function normalizeOptions(options, context) {
|
|
13
|
+
const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)();
|
|
13
14
|
if (isTsSolutionSetup && options.generatePackageJson) {
|
|
14
15
|
throw new Error(`Setting 'generatePackageJson: true' is not supported with the current TypeScript setup. Update the 'package.json' file at the project root as needed and unset the 'generatePackageJson' option. See https://nx.dev/docs/technologies/node/guides/deploying-node-projects for the recommended pruned package.json workflow.`);
|
|
15
16
|
}
|
|
@@ -42,7 +43,10 @@ function normalizeOptions(options, context) {
|
|
|
42
43
|
throw new Error(`Cannot use both esbuildOptions and esbuildConfig options. Remove one of them and try again.`);
|
|
43
44
|
if (!fs.existsSync(userDefinedConfig))
|
|
44
45
|
throw new Error(`Path of esbuildConfig does not exist: ${userDefinedConfig}`);
|
|
45
|
-
|
|
46
|
+
// Use loadConfigFile so TypeScript configs (import type, satisfies, TS
|
|
47
|
+
// plugin imports) are transpiled instead of require()'d raw.
|
|
48
|
+
userDefinedBuildOptions =
|
|
49
|
+
await (0, internal_1.loadConfigFile)(userDefinedConfig);
|
|
46
50
|
}
|
|
47
51
|
else if (options.esbuildOptions) {
|
|
48
52
|
userDefinedBuildOptions = options.esbuildOptions;
|
|
@@ -2,17 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.esbuildInitGenerator = esbuildInitGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const internal_1 = require("@nx/
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
6
7
|
const assert_supported_esbuild_version_1 = require("../../utils/assert-supported-esbuild-version");
|
|
7
8
|
const versions_1 = require("../../utils/versions");
|
|
8
9
|
async function esbuildInitGenerator(tree, schema) {
|
|
9
10
|
(0, assert_supported_esbuild_version_1.assertSupportedEsbuildVersion)(tree);
|
|
10
11
|
let installTask = () => { };
|
|
11
12
|
if (!schema.skipPackageJson) {
|
|
13
|
+
// esbuild's install script only validates the prebuilt binary shipped via
|
|
14
|
+
// optional dependencies, so skip it.
|
|
15
|
+
(0, internal_1.acknowledgeBuildScripts)(tree, (0, devkit_1.detectPackageManager)(tree.root), {
|
|
16
|
+
esbuild: false,
|
|
17
|
+
});
|
|
12
18
|
installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
13
19
|
'@nx/esbuild': versions_1.nxVersion,
|
|
14
20
|
esbuild: (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'esbuild') ??
|
|
15
|
-
|
|
21
|
+
internal_2.esbuildVersion,
|
|
16
22
|
}, undefined, schema.keepExistingVersions ?? true);
|
|
17
23
|
}
|
|
18
24
|
if (!schema.skipFormat) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/esbuild",
|
|
3
|
-
"version": "23.1.
|
|
3
|
+
"version": "23.1.1",
|
|
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": {
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"picocolors": "^1.1.0",
|
|
45
45
|
"tsconfig-paths": "^4.1.2",
|
|
46
46
|
"tslib": "^2.3.0",
|
|
47
|
-
"@nx/devkit": "23.1.
|
|
48
|
-
"@nx/js": "23.1.
|
|
47
|
+
"@nx/devkit": "23.1.1",
|
|
48
|
+
"@nx/js": "23.1.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"nx": "23.1.
|
|
51
|
+
"nx": "23.1.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"esbuild": ">=0.19.2 <1.0.0"
|