@nx/webpack 23.0.0-beta.12 → 23.0.0-beta.13
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.
- package/package.json +4 -4
- package/src/executors/dev-server/dev-server.impl.js +3 -3
- package/src/executors/webpack/lib/normalize-options.js +2 -2
- package/src/executors/webpack/schema.d.ts +1 -1
- package/src/executors/webpack/webpack.impl.js +2 -2
- package/src/generators/configuration/configuration.js +2 -2
- package/src/plugins/nx-typescript-webpack-plugin/nx-tsconfig-paths-webpack-plugin.js +5 -5
- package/src/plugins/nx-webpack-plugin/lib/apply-base-config.js +2 -2
- package/src/plugins/nx-webpack-plugin/lib/normalize-options.js +2 -2
- package/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.d.ts +1 -1
- package/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.d.ts.map +1 -1
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +5 -6
- package/src/utils/config.js +2 -2
- package/src/utils/e2e-web-server-info-utils.d.ts.map +1 -1
- package/src/utils/e2e-web-server-info-utils.js +4 -3
- package/src/utils/ensure-dependencies.js +2 -2
- package/src/utils/webpack/resolve-user-defined-webpack-config.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/webpack",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Webpack contains executors and generators that support building applications using Webpack.",
|
|
6
6
|
"repository": {
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
"webpack-dev-server": "^5.2.1",
|
|
66
66
|
"webpack-node-externals": "^3.0.0",
|
|
67
67
|
"webpack-subresource-integrity": "^5.1.0",
|
|
68
|
-
"@nx/devkit": "23.0.0-beta.
|
|
69
|
-
"@nx/js": "23.0.0-beta.
|
|
68
|
+
"@nx/devkit": "23.0.0-beta.13",
|
|
69
|
+
"@nx/js": "23.0.0-beta.13"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"nx": "23.0.0-beta.
|
|
72
|
+
"nx": "23.0.0-beta.13"
|
|
73
73
|
},
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
@@ -8,7 +8,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
8
8
|
const operators_1 = require("rxjs/operators");
|
|
9
9
|
const webpack_dev_server_1 = tslib_1.__importDefault(require("webpack-dev-server"));
|
|
10
10
|
const get_dev_server_config_1 = require("./lib/get-dev-server-config");
|
|
11
|
-
const
|
|
11
|
+
const internal_2 = require("@nx/js/internal");
|
|
12
12
|
const run_webpack_1 = require("../../utils/run-webpack");
|
|
13
13
|
const resolve_user_defined_webpack_config_1 = require("../../utils/webpack/resolve-user-defined-webpack-config");
|
|
14
14
|
const deprecation_1 = require("../../utils/deprecation");
|
|
@@ -28,9 +28,9 @@ async function* devServerExecutor(serveOptions, context) {
|
|
|
28
28
|
if (!buildOptions.tsConfig) {
|
|
29
29
|
throw new Error(`Cannot find "tsConfig" to remap paths for. Set this option in project.json.`);
|
|
30
30
|
}
|
|
31
|
-
const { target, dependencies } = (0,
|
|
31
|
+
const { target, dependencies } = (0, internal_2.calculateProjectBuildableDependencies)(context.taskGraph, context.projectGraph, context.root, context.projectName, 'build', // should be generalized
|
|
32
32
|
context.configurationName);
|
|
33
|
-
buildOptions.tsConfig = (0,
|
|
33
|
+
buildOptions.tsConfig = (0, internal_2.createTmpTsConfig)(buildOptions.tsConfig, context.root, target.data.root, dependencies);
|
|
34
34
|
process.env.NX_TSCONFIG_PATH = buildOptions.tsConfig;
|
|
35
35
|
}
|
|
36
36
|
let config;
|
|
@@ -4,11 +4,11 @@ exports.normalizeOptions = normalizeOptions;
|
|
|
4
4
|
exports.normalizePluginPath = normalizePluginPath;
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const normalize_options_1 = require("../../../plugins/nx-webpack-plugin/lib/normalize-options");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
function normalizeOptions(options, root, projectRoot, sourceRoot) {
|
|
9
9
|
const normalizedOptions = {
|
|
10
10
|
...options,
|
|
11
|
-
useTsconfigPaths: !(0,
|
|
11
|
+
useTsconfigPaths: !(0, internal_1.isUsingTsSolutionSetup)(),
|
|
12
12
|
root,
|
|
13
13
|
projectRoot,
|
|
14
14
|
sourceRoot,
|
|
@@ -4,7 +4,7 @@ exports.webpackExecutor = webpackExecutor;
|
|
|
4
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
|
-
const
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const rxjs_1 = require("rxjs");
|
|
10
10
|
const operators_1 = require("rxjs/operators");
|
|
@@ -51,7 +51,7 @@ async function* webpackExecutor(_options, context) {
|
|
|
51
51
|
// Default to production build.
|
|
52
52
|
process.env['NODE_ENV'] ||= 'production';
|
|
53
53
|
const metadata = context.projectsConfigurations.projects[context.projectName];
|
|
54
|
-
const sourceRoot = (0,
|
|
54
|
+
const sourceRoot = (0, internal_2.getProjectSourceRoot)(metadata);
|
|
55
55
|
const options = (0, normalize_options_1.normalizeOptions)(_options, context.root, metadata.root, sourceRoot);
|
|
56
56
|
const isScriptOptimizeOn = typeof options.optimization === 'boolean'
|
|
57
57
|
? options.optimization
|
|
@@ -7,7 +7,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
7
7
|
const init_1 = require("../init/init");
|
|
8
8
|
const has_plugin_1 = require("../../utils/has-plugin");
|
|
9
9
|
const deprecation_1 = require("../../utils/deprecation");
|
|
10
|
-
const
|
|
10
|
+
const internal_2 = require("@nx/js/internal");
|
|
11
11
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
12
12
|
function configurationGenerator(tree, options) {
|
|
13
13
|
return configurationGeneratorInternal(tree, { addPlugin: false, ...options });
|
|
@@ -131,7 +131,7 @@ module.exports = composePlugins(withNx(), (config) => {
|
|
|
131
131
|
}
|
|
132
132
|
function addBuildTarget(tree, options) {
|
|
133
133
|
(0, internal_1.addBuildTargetDefaults)(tree, '@nx/webpack:webpack', 'build', [
|
|
134
|
-
|
|
134
|
+
internal_2.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
|
|
135
135
|
]);
|
|
136
136
|
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
137
137
|
const buildOptions = {
|
|
@@ -5,8 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const path = tslib_1.__importStar(require("path"));
|
|
6
6
|
const tsconfig_paths_webpack_plugin_1 = require("tsconfig-paths-webpack-plugin");
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const internal_1 = require("@nx/js/internal");
|
|
9
|
+
const js_1 = require("@nx/js");
|
|
10
10
|
const webpack_nx_build_coordination_plugin_1 = require("../webpack-nx-build-coordination-plugin");
|
|
11
11
|
class NxTsconfigPathsWebpackPlugin {
|
|
12
12
|
constructor(options) {
|
|
@@ -30,7 +30,7 @@ class NxTsconfigPathsWebpackPlugin {
|
|
|
30
30
|
: this.options.tsConfig;
|
|
31
31
|
compiler.options.resolve.plugins.push(new tsconfig_paths_webpack_plugin_1.TsconfigPathsPlugin({
|
|
32
32
|
configFile,
|
|
33
|
-
baseUrl: (0,
|
|
33
|
+
baseUrl: (0, js_1.resolvePathsBaseUrl)(configFile),
|
|
34
34
|
extensions: Array.from(extensions),
|
|
35
35
|
mainFields: ['module', 'main'],
|
|
36
36
|
}));
|
|
@@ -38,8 +38,8 @@ class NxTsconfigPathsWebpackPlugin {
|
|
|
38
38
|
handleBuildLibsFromSource(config, options) {
|
|
39
39
|
if (!options.buildLibsFromSource && options.targetName) {
|
|
40
40
|
const remappedTarget = options.targetName === 'serve' ? 'build' : options.targetName;
|
|
41
|
-
const { target, dependencies } = (0,
|
|
42
|
-
options.tsConfig = (0,
|
|
41
|
+
const { target, dependencies } = (0, internal_1.calculateProjectBuildableDependencies)(undefined, options.projectGraph, options.root, options.projectName, remappedTarget, options.configurationName);
|
|
42
|
+
options.tsConfig = (0, internal_1.createTmpTsConfig)(options.tsConfig, options.root, target.data.root, dependencies);
|
|
43
43
|
if (options.targetName === 'serve') {
|
|
44
44
|
const buildableDependencies = dependencies
|
|
45
45
|
.filter((dependency) => dependency.node.type === 'lib')
|
|
@@ -15,7 +15,7 @@ const get_terser_ecma_version_1 = require("./get-terser-ecma-version");
|
|
|
15
15
|
const compiler_loaders_1 = require("./compiler-loaders");
|
|
16
16
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
17
17
|
const nodeExternals = require("webpack-node-externals");
|
|
18
|
-
const
|
|
18
|
+
const internal_1 = require("@nx/js/internal");
|
|
19
19
|
const utils_1 = require("./utils");
|
|
20
20
|
const IGNORED_WEBPACK_WARNINGS = [
|
|
21
21
|
/The comment file/i,
|
|
@@ -208,7 +208,7 @@ function applyNxDependentConfig(options, config, { useNormalizedEntry } = {}) {
|
|
|
208
208
|
configurationName: options.configurationName,
|
|
209
209
|
root: options.root,
|
|
210
210
|
};
|
|
211
|
-
const isUsingTsSolution = (0,
|
|
211
|
+
const isUsingTsSolution = (0, internal_1.isUsingTsSolutionSetup)();
|
|
212
212
|
options.useTsconfigPaths ??= !isUsingTsSolution;
|
|
213
213
|
// If the project is using ts solutions setup, the paths are not in tsconfig and we should not use the plugin's paths.
|
|
214
214
|
if (options.useTsconfigPaths) {
|
|
@@ -4,7 +4,7 @@ exports.normalizeOptions = normalizeOptions;
|
|
|
4
4
|
exports.normalizeAssets = normalizeAssets;
|
|
5
5
|
exports.normalizeFileReplacements = normalizeFileReplacements;
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
const path_1 = require("path");
|
|
10
10
|
function normalizeOptions(options) {
|
|
@@ -49,7 +49,7 @@ function normalizeOptions(options) {
|
|
|
49
49
|
// executor options take precedence (especially for overriding with CLI args)
|
|
50
50
|
originalTargetOptions);
|
|
51
51
|
}
|
|
52
|
-
const sourceRoot = (0,
|
|
52
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(projectNode.data);
|
|
53
53
|
if (!combinedPluginAndMaybeExecutorOptions.main) {
|
|
54
54
|
throw new Error(`Missing "main" option for the entry file. Set this option in your Nx webpack plugin.`);
|
|
55
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx-app-webpack-plugin-options.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"nx-app-webpack-plugin-options.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/plugins/nx-webpack-plugin/nx-app-webpack-plugin-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;A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,CAAC;CAC7B;AAED,MAAM,WAAW,mCACf,SAAQ,yBAAyB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/plugins/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,kBAAkB,EAIlB,aAAa,EAOd,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/plugins/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,kBAAkB,EAIlB,aAAa,EAOd,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,oBAAoB;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,oBAAoB,CAkC3D,CAAC;AAEF,eAAO,MAAM,aAAa,qCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -4,14 +4,13 @@ exports.createNodesV2 = exports.createNodes = exports.createDependencies = void
|
|
|
4
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
|
-
const
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
const file_hasher_1 = require("nx/src/hasher/file-hasher");
|
|
10
10
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
11
11
|
const path_1 = require("path");
|
|
12
12
|
const read_webpack_options_1 = require("../utils/webpack/read-webpack-options");
|
|
13
13
|
const resolve_user_defined_webpack_config_1 = require("../utils/webpack/resolve-user-defined-webpack-config");
|
|
14
|
-
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
15
14
|
/**
|
|
16
15
|
* @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
|
|
17
16
|
*/
|
|
@@ -27,7 +26,7 @@ exports.createNodes = [
|
|
|
27
26
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `webpack-${optionsHash}.hash`);
|
|
28
27
|
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
29
28
|
const normalizedOptions = normalizeOptions(options);
|
|
30
|
-
const isTsSolutionSetup = (0,
|
|
29
|
+
const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)();
|
|
31
30
|
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
32
31
|
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
33
32
|
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
@@ -86,7 +85,7 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
|
|
|
86
85
|
{
|
|
87
86
|
externalDependencies: ['webpack-cli'],
|
|
88
87
|
},
|
|
89
|
-
|
|
88
|
+
internal_2.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
|
|
90
89
|
]
|
|
91
90
|
: [
|
|
92
91
|
'default',
|
|
@@ -94,7 +93,7 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
|
|
|
94
93
|
{
|
|
95
94
|
externalDependencies: ['webpack-cli'],
|
|
96
95
|
},
|
|
97
|
-
|
|
96
|
+
internal_2.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
|
|
98
97
|
],
|
|
99
98
|
outputs,
|
|
100
99
|
metadata: {
|
|
@@ -179,7 +178,7 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
|
|
|
179
178
|
'@nx/js:typescript-sync',
|
|
180
179
|
];
|
|
181
180
|
}
|
|
182
|
-
(0,
|
|
181
|
+
(0, internal_2.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmc);
|
|
183
182
|
return { targets, metadata: {} };
|
|
184
183
|
}
|
|
185
184
|
function normalizeOutputPath(outputPath, projectRoot) {
|
package/src/utils/config.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.isNxWebpackComposablePlugin = isNxWebpackComposablePlugin;
|
|
|
5
5
|
exports.composePlugins = composePlugins;
|
|
6
6
|
exports.composePluginsSync = composePluginsSync;
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
|
-
const
|
|
8
|
+
const internal_1 = require("@nx/js/internal");
|
|
9
9
|
const configuration_1 = require("nx/src/config/configuration");
|
|
10
10
|
exports.nxWebpackComposablePlugin = 'nxWebpackComposablePlugin';
|
|
11
11
|
function isNxWebpackComposablePlugin(a) {
|
|
@@ -50,7 +50,7 @@ function ensureNxWebpackExecutionContext(ctx) {
|
|
|
50
50
|
ctx.options ??= {
|
|
51
51
|
root: devkit_1.workspaceRoot,
|
|
52
52
|
projectRoot: projectNode.data.root,
|
|
53
|
-
sourceRoot: (0,
|
|
53
|
+
sourceRoot: (0, internal_1.getProjectSourceRoot)(projectNode.data),
|
|
54
54
|
// These aren't actually needed since NxWebpackPlugin and withNx both support them being undefined.
|
|
55
55
|
assets: undefined,
|
|
56
56
|
outputPath: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e-web-server-info-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/utils/e2e-web-server-info-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"e2e-web-server-info-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/utils/e2e-web-server-info-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAC;AAMnD,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,CAAC,EAAE,MAAM,8DA6BzB"}
|
|
@@ -6,9 +6,10 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
6
6
|
async function getWebpackE2EWebServerInfo(tree, projectName, configFilePath, isPluginBeingAdded, e2ePortOverride) {
|
|
7
7
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
8
8
|
let e2ePort = e2ePortOverride ?? 4200;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const servePort = (0, internal_1.readTargetDefaultsForTarget)('serve', nxJson.targetDefaults)
|
|
10
|
+
?.options?.port;
|
|
11
|
+
if (servePort) {
|
|
12
|
+
e2ePort = servePort;
|
|
12
13
|
}
|
|
13
14
|
return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
|
|
14
15
|
plugin: '@nx/webpack/plugin',
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ensureDependencies = ensureDependencies;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
const versions_1 = require("./versions");
|
|
7
7
|
function ensureDependencies(tree, options) {
|
|
8
8
|
const tasks = [];
|
|
9
9
|
const devDependencies = {};
|
|
10
10
|
if (options.compiler === 'swc') {
|
|
11
11
|
devDependencies['swc-loader'] = versions_1.swcLoaderVersion;
|
|
12
|
-
const addSwcTask = (0,
|
|
12
|
+
const addSwcTask = (0, internal_1.addSwcDependencies)(tree);
|
|
13
13
|
tasks.push(addSwcTask);
|
|
14
14
|
}
|
|
15
15
|
if (options.compiler === 'tsc') {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveUserDefinedWebpackConfig = resolveUserDefinedWebpackConfig;
|
|
4
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
5
|
-
const internal_2 = require("@nx/js/
|
|
5
|
+
const internal_2 = require("@nx/js/internal");
|
|
6
6
|
function resolveUserDefinedWebpackConfig(path, tsConfig,
|
|
7
7
|
/** Skip require cache and return latest content */
|
|
8
8
|
reload = false) {
|