@nx/webpack 23.2.0-beta.1 → 23.2.0-beta.11
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/README.md +2 -2
- package/dist/src/executors/webpack/schema.d.ts +1 -2
- package/dist/src/generators/convert-to-inferred/convert-to-inferred.d.ts +1 -2
- package/dist/src/generators/convert-to-inferred/convert-to-inferred.js +2 -3
- package/dist/src/plugins/generate-package-json-plugin.js +6 -9
- package/dist/src/plugins/nx-webpack-plugin/lib/apply-base-config.js +23 -5
- package/dist/src/plugins/nx-webpack-plugin/lib/stylesheet-loaders.d.ts +2 -0
- package/dist/src/plugins/nx-webpack-plugin/lib/stylesheet-loaders.js +5 -0
- package/dist/src/plugins/plugin.js +23 -26
- package/dist/src/plugins/use-legacy-nx-plugin/use-legacy-nx-plugin.js +2 -2
- package/dist/src/plugins/webpack-nx-build-coordination-plugin.js +8 -9
- package/dist/src/utils/config.js +2 -2
- package/dist/src/utils/fs.js +2 -2
- package/dist/src/utils/webpack/read-webpack-options.js +2 -2
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
<div style="text-align: center;">
|
|
9
9
|
|
|
10
|
-
[]()
|
|
10
|
+
[](<>)
|
|
11
11
|
[](https://www.npmjs.com/package/nx)
|
|
12
|
-
[]()
|
|
12
|
+
[](<>)
|
|
13
13
|
[](http://commitizen.github.io/cz-cli/)
|
|
14
14
|
[](https://go.nx.dev/community)
|
|
15
15
|
[](https://nx.dev/docs/features/ci-features/sandboxing)
|
|
@@ -93,8 +93,7 @@ export interface WebpackExecutorOptions {
|
|
|
93
93
|
rebaseRootRelative?: boolean;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
export interface NormalizedWebpackExecutorOptions
|
|
97
|
-
extends WebpackExecutorOptions {
|
|
96
|
+
export interface NormalizedWebpackExecutorOptions extends WebpackExecutorOptions {
|
|
98
97
|
outputFileName: string;
|
|
99
98
|
assets: AssetGlobPattern[];
|
|
100
99
|
root: string;
|
|
@@ -8,7 +8,6 @@ const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
|
8
8
|
const plugin_1 = require("../../plugins/plugin");
|
|
9
9
|
const versions_1 = require("../../utils/versions");
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
|
-
const devkit_exports_1 = require("nx/src/devkit-exports");
|
|
12
11
|
async function convertToInferred(tree, options) {
|
|
13
12
|
(0, versions_1.assertSupportedWebpackVersion)(tree);
|
|
14
13
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
@@ -90,12 +89,12 @@ function createCollectingLogger() {
|
|
|
90
89
|
loggedMessages.forEach((messages, method) => {
|
|
91
90
|
messages.forEach((message) => {
|
|
92
91
|
if (!filter || filter(message)) {
|
|
93
|
-
|
|
92
|
+
devkit_1.logger[method](message);
|
|
94
93
|
}
|
|
95
94
|
});
|
|
96
95
|
});
|
|
97
96
|
};
|
|
98
|
-
return new Proxy({ ...
|
|
97
|
+
return new Proxy({ ...devkit_1.logger, loggedMessages, flushLogs }, {
|
|
99
98
|
get(target, property) {
|
|
100
99
|
const originalMethod = target[property];
|
|
101
100
|
if (typeof originalMethod === 'function') {
|
|
@@ -55,16 +55,13 @@ class GeneratePackageJsonPlugin {
|
|
|
55
55
|
...packageJson.dependencies,
|
|
56
56
|
...runtimeDependencies,
|
|
57
57
|
};
|
|
58
|
-
compilation.emitAsset('package.json', new sources.RawSource((0, devkit_1.serializeJson)(packageJson)));
|
|
59
58
|
const packageManager = (0, devkit_1.detectPackageManager)(this.options.root);
|
|
60
|
-
|
|
61
|
-
compilation
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
compilation.emitAsset((0, js_1.getLockFileName)(packageManager), new sources.RawSource((0, js_1.createLockFile)(packageJson, this.options.projectGraph, packageManager)));
|
|
67
|
-
}
|
|
59
|
+
(0, js_1.generatePrunedDeployOutput)(packageJson, this.options.projectGraph, this.options.projectGraph.nodes[this.options.projectName].data.root, {
|
|
60
|
+
emit: (assetPath, content) => compilation.emitAsset(assetPath, new sources.RawSource(content)),
|
|
61
|
+
packageManager,
|
|
62
|
+
workspaceRoot: this.options.root,
|
|
63
|
+
});
|
|
64
|
+
compilation.emitAsset('package.json', new sources.RawSource((0, devkit_1.serializeJson)(packageJson)));
|
|
68
65
|
});
|
|
69
66
|
});
|
|
70
67
|
}
|
|
@@ -24,6 +24,23 @@ const extensionAlias = {
|
|
|
24
24
|
};
|
|
25
25
|
const extensions = ['.ts', '.tsx', '.mjs', '.js', '.jsx'];
|
|
26
26
|
const mainFields = ['module', 'main'];
|
|
27
|
+
/**
|
|
28
|
+
* `withNx` builds a raw config that webpack validates, and only the boolean is
|
|
29
|
+
* schema-valid before 5.110. `NxAppWebpackPlugin` instead mutates options that
|
|
30
|
+
* are already normalized, which 5.110 fills by setting `.javascript` on
|
|
31
|
+
* `minimize`, so a boolean throws there.
|
|
32
|
+
*/
|
|
33
|
+
function setMinimizeValue(optimization, shouldMinify, configIsNormalized) {
|
|
34
|
+
if (!shouldMinify) {
|
|
35
|
+
optimization.minimize = false;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (configIsNormalized) {
|
|
39
|
+
optimization.minimize = {};
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
optimization.minimize = true;
|
|
43
|
+
}
|
|
27
44
|
function applyBaseConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
28
45
|
// Defaults that was applied from executor schema previously.
|
|
29
46
|
options.compiler ??= 'babel';
|
|
@@ -31,13 +48,13 @@ function applyBaseConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
31
48
|
options.fileReplacements ??= [];
|
|
32
49
|
options.memoryLimit ??= 2048;
|
|
33
50
|
options.transformers ??= [];
|
|
34
|
-
applyNxIndependentConfig(options, config);
|
|
51
|
+
applyNxIndependentConfig(options, config, !!useNormalizedEntry);
|
|
35
52
|
// Some of the options only work during actual tasks, not when reading the webpack config during CreateNodes.
|
|
36
53
|
if (global.NX_GRAPH_CREATION)
|
|
37
54
|
return;
|
|
38
55
|
applyNxDependentConfig(options, config, { useNormalizedEntry });
|
|
39
56
|
}
|
|
40
|
-
function applyNxIndependentConfig(options, config) {
|
|
57
|
+
function applyNxIndependentConfig(options, config, configIsNormalized) {
|
|
41
58
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
42
59
|
const hashFormat = (0, hash_format_1.getOutputHashFormat)(options.outputHashing);
|
|
43
60
|
config.context = path.join(options.root, options.projectRoot);
|
|
@@ -126,12 +143,12 @@ function applyNxIndependentConfig(options, config) {
|
|
|
126
143
|
(x) => IGNORED_WEBPACK_WARNINGS.some((r) => typeof x === 'string' ? r.test(x) : r.test(x.message)),
|
|
127
144
|
...(config.ignoreWarnings ?? []),
|
|
128
145
|
];
|
|
146
|
+
const shouldMinify = typeof options.optimization === 'object'
|
|
147
|
+
? !!options.optimization.scripts
|
|
148
|
+
: !!options.optimization;
|
|
129
149
|
config.optimization = {
|
|
130
150
|
...config.optimization,
|
|
131
151
|
sideEffects: true,
|
|
132
|
-
minimize: typeof options.optimization === 'object'
|
|
133
|
-
? !!options.optimization.scripts
|
|
134
|
-
: !!options.optimization,
|
|
135
152
|
minimizer: [
|
|
136
153
|
options.compiler !== 'swc'
|
|
137
154
|
? new TerserPlugin({
|
|
@@ -164,6 +181,7 @@ function applyNxIndependentConfig(options, config) {
|
|
|
164
181
|
runtimeChunk: false,
|
|
165
182
|
concatenateModules: true,
|
|
166
183
|
};
|
|
184
|
+
setMinimizeValue(config.optimization, shouldMinify, configIsNormalized);
|
|
167
185
|
config.stats = {
|
|
168
186
|
hash: true,
|
|
169
187
|
timings: false,
|
|
@@ -13,6 +13,8 @@ export declare function getCommonLoadersForCssModules(options: NormalizedNxAppWe
|
|
|
13
13
|
modules: {
|
|
14
14
|
mode: string;
|
|
15
15
|
getLocalIdent: typeof getCSSModuleLocalIdent;
|
|
16
|
+
namedExport: boolean;
|
|
17
|
+
exportLocalsConvention: string;
|
|
16
18
|
};
|
|
17
19
|
importLoaders: number;
|
|
18
20
|
implementation?: undefined;
|
|
@@ -25,6 +25,11 @@ function getCommonLoadersForCssModules(options, includePaths) {
|
|
|
25
25
|
modules: {
|
|
26
26
|
mode: 'local',
|
|
27
27
|
getLocalIdent: get_css_module_local_ident_1.getCSSModuleLocalIdent,
|
|
28
|
+
// css-loader 7 defaults namedExport to true, and to camel-case-only
|
|
29
|
+
// locals when it is off. Generated components import the default
|
|
30
|
+
// export and reference class names as authored, so pin both.
|
|
31
|
+
namedExport: false,
|
|
32
|
+
exportLocalsConvention: 'asIs',
|
|
28
33
|
},
|
|
29
34
|
importLoaders: 1,
|
|
30
35
|
},
|
|
@@ -6,8 +6,6 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
7
|
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
|
-
const file_hasher_1 = require("nx/src/hasher/file-hasher");
|
|
10
|
-
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
11
9
|
const path_1 = require("path");
|
|
12
10
|
const read_webpack_options_1 = require("../utils/webpack/read-webpack-options");
|
|
13
11
|
const resolve_user_defined_webpack_config_1 = require("../utils/webpack/resolve-user-defined-webpack-config");
|
|
@@ -22,21 +20,22 @@ const webpackConfigGlob = '**/webpack.config.{js,ts,mjs,cjs}';
|
|
|
22
20
|
exports.createNodes = [
|
|
23
21
|
webpackConfigGlob,
|
|
24
22
|
async (configFilePaths, options, context) => {
|
|
25
|
-
const optionsHash = (0,
|
|
26
|
-
const cachePath = (0, path_1.join)(
|
|
23
|
+
const optionsHash = (0, internal_1.hashObject)(options);
|
|
24
|
+
const cachePath = (0, path_1.join)(internal_1.workspaceDataDirectory, `webpack-${optionsHash}.hash`);
|
|
27
25
|
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
28
26
|
const normalizedOptions = normalizeOptions(options);
|
|
29
27
|
const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)();
|
|
30
28
|
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
31
29
|
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
32
30
|
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
31
|
+
const includePnpmMajorRuntimeInput = (0, internal_2.shouldIncludePnpmMajorRuntimeInput)(packageManager, context.workspaceRoot);
|
|
33
32
|
try {
|
|
34
33
|
const { entries, preErrors } = await filterWebpackConfigs(configFilePaths, context);
|
|
35
|
-
const projectHashes = await (0, internal_1.calculateHashesForCreateNodes)(entries.map((e) => e.projectRoot), normalizedOptions, context, entries.map(() => [lockFileName]));
|
|
34
|
+
const projectHashes = await (0, internal_1.calculateHashesForCreateNodes)(entries.map((e) => e.projectRoot), { ...normalizedOptions, includePnpmMajorRuntimeInput }, context, entries.map(() => [lockFileName]));
|
|
36
35
|
let results = [];
|
|
37
36
|
let nodeErrors = [];
|
|
38
37
|
try {
|
|
39
|
-
results = await (0, devkit_1.createNodesFromFiles)((configFile, opts, ctx, idx) => createNodesInternal(configFile, opts, ctx, targetsCache, isTsSolutionSetup, pmc, projectHashes[idx]), entries.map((e) => e.configFile), normalizedOptions, context);
|
|
38
|
+
results = await (0, devkit_1.createNodesFromFiles)((configFile, opts, ctx, idx) => createNodesInternal(configFile, opts, ctx, targetsCache, isTsSolutionSetup, packageManager, pmc, includePnpmMajorRuntimeInput, projectHashes[idx]), entries.map((e) => e.configFile), normalizedOptions, context);
|
|
40
39
|
}
|
|
41
40
|
catch (e) {
|
|
42
41
|
if (e instanceof devkit_1.AggregateCreateNodesError) {
|
|
@@ -59,10 +58,10 @@ exports.createNodes = [
|
|
|
59
58
|
},
|
|
60
59
|
];
|
|
61
60
|
exports.createNodesV2 = exports.createNodes;
|
|
62
|
-
async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, pmc, hash) {
|
|
61
|
+
async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, packageManager, pmc, includePnpmMajorRuntimeInput, hash) {
|
|
63
62
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
64
63
|
if (!targetsCache.has(hash)) {
|
|
65
|
-
targetsCache.set(hash, await createWebpackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc));
|
|
64
|
+
targetsCache.set(hash, await createWebpackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, packageManager, pmc, includePnpmMajorRuntimeInput));
|
|
66
65
|
}
|
|
67
66
|
const { targets, metadata } = targetsCache.get(hash);
|
|
68
67
|
return {
|
|
@@ -75,7 +74,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
|
|
|
75
74
|
},
|
|
76
75
|
};
|
|
77
76
|
}
|
|
78
|
-
async function createWebpackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc) {
|
|
77
|
+
async function createWebpackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, packageManager, pmc, includePnpmMajorRuntimeInput) {
|
|
79
78
|
const namedInputs = (0, internal_1.getNamedInputs)(projectRoot, context);
|
|
80
79
|
const webpackConfig = (0, resolve_user_defined_webpack_config_1.resolveUserDefinedWebpackConfig)((0, path_1.join)(context.workspaceRoot, configFilePath), (0, js_1.getRootTsConfigPath)(), true);
|
|
81
80
|
const webpackOptions = await (0, read_webpack_options_1.readWebpackOptions)(webpackConfig);
|
|
@@ -91,23 +90,21 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
|
|
|
91
90
|
options: { cwd: projectRoot, env: { NODE_ENV: 'production' } },
|
|
92
91
|
cache: true,
|
|
93
92
|
dependsOn: [`^${options.buildTargetName}`],
|
|
94
|
-
inputs:
|
|
95
|
-
|
|
96
|
-
'production',
|
|
97
|
-
'^
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
internal_2.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
|
|
110
|
-
],
|
|
93
|
+
inputs: [
|
|
94
|
+
...('production' in namedInputs
|
|
95
|
+
? ['production', '^production']
|
|
96
|
+
: ['default', '^default']),
|
|
97
|
+
{
|
|
98
|
+
externalDependencies: ['webpack-cli'],
|
|
99
|
+
},
|
|
100
|
+
internal_2.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
|
|
101
|
+
// The build can emit a pruned pnpm deploy output (NxAppWebpackPlugin
|
|
102
|
+
// with generatePackageJson), whose install settings come from these
|
|
103
|
+
// otherwise-unhashed root sources.
|
|
104
|
+
...(packageManager === 'pnpm'
|
|
105
|
+
? (0, internal_2.pnpmInstallSettingsInputsForInferredTarget)(includePnpmMajorRuntimeInput)
|
|
106
|
+
: []),
|
|
107
|
+
],
|
|
111
108
|
outputs,
|
|
112
109
|
metadata: {
|
|
113
110
|
technologies: ['webpack'],
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useLegacyNxPlugin = useLegacyNxPlugin;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const normalize_options_1 = require("../nx-webpack-plugin/lib/normalize-options");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
/**
|
|
8
8
|
* This function is used to wrap the legacy plugin function to be used with the `composePlugins` function.
|
|
9
9
|
* Initially the webpack config would be passed to the legacy plugin function and the options would be passed as a second argument.
|
|
@@ -44,7 +44,7 @@ async function useLegacyNxPlugin(fn, executorOptions) {
|
|
|
44
44
|
root: devkit_1.workspaceRoot,
|
|
45
45
|
projectGraph,
|
|
46
46
|
projectsConfigurations: (0, devkit_1.readProjectsConfigurationFromProjectGraph)(projectGraph),
|
|
47
|
-
nxJsonConfiguration: (0,
|
|
47
|
+
nxJsonConfiguration: (0, internal_1.readNxJsonFromDisk)(devkit_1.workspaceRoot),
|
|
48
48
|
target: project.data.targets[targetName],
|
|
49
49
|
targetName: targetName,
|
|
50
50
|
projectName: projectName,
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WebpackNxBuildCoordinationPlugin = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const output_1 = require("nx/src/utils/output");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
8
7
|
class WebpackNxBuildCoordinationPlugin {
|
|
9
8
|
constructor(buildCmd, skipInitialBuildOrOptions) {
|
|
10
9
|
this.buildCmd = buildCmd;
|
|
@@ -17,11 +16,11 @@ class WebpackNxBuildCoordinationPlugin {
|
|
|
17
16
|
this.buildChangedProjects();
|
|
18
17
|
}
|
|
19
18
|
if (!options?.skipWatchingDeps) {
|
|
20
|
-
if ((0,
|
|
19
|
+
if ((0, devkit_1.isDaemonEnabled)()) {
|
|
21
20
|
this.startWatchingBuildableLibs();
|
|
22
21
|
}
|
|
23
22
|
else {
|
|
24
|
-
|
|
23
|
+
devkit_1.output.warn({
|
|
25
24
|
title: 'Nx Daemon is not enabled. Buildable libs will not be rebuilt on file changes.',
|
|
26
25
|
});
|
|
27
26
|
}
|
|
@@ -70,8 +69,8 @@ class WebpackNxBuildCoordinationPlugin {
|
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
createFileWatcher() {
|
|
73
|
-
const runner = new
|
|
74
|
-
return
|
|
72
|
+
const runner = new internal_1.BatchFunctionRunner(() => this.buildChangedProjects());
|
|
73
|
+
return internal_1.daemonClient.registerFileWatcher({
|
|
75
74
|
watchProjects: 'all',
|
|
76
75
|
}, (err, { changedProjects, changedFiles }) => {
|
|
77
76
|
if (err === 'reconnecting') {
|
|
@@ -83,13 +82,13 @@ class WebpackNxBuildCoordinationPlugin {
|
|
|
83
82
|
return;
|
|
84
83
|
}
|
|
85
84
|
else if (err === 'closed') {
|
|
86
|
-
|
|
85
|
+
devkit_1.output.error({
|
|
87
86
|
title: 'Failed to reconnect to daemon after multiple attempts',
|
|
88
87
|
});
|
|
89
88
|
process.exit(1);
|
|
90
89
|
}
|
|
91
90
|
else if (err) {
|
|
92
|
-
|
|
91
|
+
devkit_1.output.error({
|
|
93
92
|
title: `Watch error: ${err?.message ?? 'Unknown'}`,
|
|
94
93
|
});
|
|
95
94
|
}
|
package/dist/src/utils/config.js
CHANGED
|
@@ -6,8 +6,8 @@ exports.composePlugins = composePlugins;
|
|
|
6
6
|
exports.composePluginsSync = composePluginsSync;
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
8
|
const internal_1 = require("@nx/js/internal");
|
|
9
|
-
const configuration_1 = require("nx/src/config/configuration");
|
|
10
9
|
const deprecation_1 = require("./deprecation");
|
|
10
|
+
const internal_2 = require("@nx/devkit/internal");
|
|
11
11
|
exports.nxWebpackComposablePlugin = 'nxWebpackComposablePlugin';
|
|
12
12
|
function isNxWebpackComposablePlugin(a) {
|
|
13
13
|
return a?.[exports.nxWebpackComposablePlugin] === true;
|
|
@@ -78,7 +78,7 @@ function ensureNxWebpackExecutionContext(ctx) {
|
|
|
78
78
|
targetName,
|
|
79
79
|
configurationName,
|
|
80
80
|
projectsConfigurations: (0, devkit_1.readProjectsConfigurationFromProjectGraph)(projectGraph),
|
|
81
|
-
nxJsonConfiguration: (0,
|
|
81
|
+
nxJsonConfiguration: (0, internal_2.readNxJsonFromDisk)(devkit_1.workspaceRoot),
|
|
82
82
|
cwd: process.cwd(),
|
|
83
83
|
root: devkit_1.workspaceRoot,
|
|
84
84
|
isVerbose: process.env['NX_VERBOSE_LOGGING'] === 'true',
|
package/dist/src/utils/fs.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.deleteOutputDir = deleteOutputDir;
|
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const path = tslib_1.__importStar(require("path"));
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
|
-
const
|
|
9
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
10
10
|
function findUp(names, from, stopOnNodeModules = false) {
|
|
11
11
|
if (!Array.isArray(names)) {
|
|
12
12
|
names = [names];
|
|
@@ -35,7 +35,7 @@ function findAllNodeModules(from, root) {
|
|
|
35
35
|
let current = from;
|
|
36
36
|
while (current && current !== root) {
|
|
37
37
|
const potential = path.join(current, 'node_modules');
|
|
38
|
-
if ((0,
|
|
38
|
+
if ((0, internal_1.directoryExists)(potential)) {
|
|
39
39
|
nodeModules.push(potential);
|
|
40
40
|
}
|
|
41
41
|
const next = path.dirname(current);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.readWebpackOptions = readWebpackOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const config_1 = require("../config");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
/**
|
|
8
8
|
* Reads the webpack options from a give webpack configuration. The configuration can be:
|
|
9
9
|
* 1. A standard config object
|
|
@@ -34,7 +34,7 @@ async function readWebpackOptions(webpackConfig) {
|
|
|
34
34
|
isVerbose: false,
|
|
35
35
|
projectsConfigurations: null,
|
|
36
36
|
projectGraph: null,
|
|
37
|
-
nxJsonConfiguration: (0,
|
|
37
|
+
nxJsonConfiguration: (0, internal_1.readNxJsonFromDisk)(devkit_1.workspaceRoot),
|
|
38
38
|
},
|
|
39
39
|
});
|
|
40
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/webpack",
|
|
3
|
-
"version": "23.2.0-beta.
|
|
3
|
+
"version": "23.2.0-beta.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@babel/core": "^7.
|
|
89
|
+
"@babel/core": "^7.29.6",
|
|
90
90
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
91
91
|
"ajv": "^8.0.0",
|
|
92
92
|
"autoprefixer": "^10.4.9",
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
"browserslist": "^4.26.0",
|
|
95
95
|
"picocolors": "^1.1.0",
|
|
96
96
|
"copy-webpack-plugin": "^14.0.0",
|
|
97
|
-
"css-loader": "^
|
|
97
|
+
"css-loader": "^7.1.4",
|
|
98
98
|
"css-minimizer-webpack-plugin": "^8.0.0",
|
|
99
99
|
"fork-ts-checker-webpack-plugin": "9.1.0",
|
|
100
|
-
"less": ">=4.1.3 <4.
|
|
100
|
+
"less": ">=4.1.3 <4.9.0",
|
|
101
101
|
"less-loader": "^12.2.0",
|
|
102
102
|
"license-webpack-plugin": "^4.0.2",
|
|
103
103
|
"loader-utils": "^2.0.3",
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
"tslib": "^2.3.0",
|
|
119
119
|
"webpack-node-externals": "^3.0.0",
|
|
120
120
|
"webpack-subresource-integrity": "^5.1.0",
|
|
121
|
-
"@nx/devkit": "23.2.0-beta.
|
|
122
|
-
"@nx/js": "23.2.0-beta.
|
|
121
|
+
"@nx/devkit": "23.2.0-beta.11",
|
|
122
|
+
"@nx/js": "23.2.0-beta.11"
|
|
123
123
|
},
|
|
124
124
|
"peerDependencies": {
|
|
125
125
|
"webpack": "^5.0.0",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
|
-
"nx": "23.2.0-beta.
|
|
141
|
+
"nx": "23.2.0-beta.11"
|
|
142
142
|
},
|
|
143
143
|
"publishConfig": {
|
|
144
144
|
"access": "public"
|