@nx/webpack 19.0.3 → 19.0.5
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/webpack",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.5",
|
|
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": {
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"webpack-dev-server": "^4.9.3",
|
|
64
64
|
"webpack-node-externals": "^3.0.0",
|
|
65
65
|
"webpack-subresource-integrity": "^5.1.0",
|
|
66
|
-
"@nx/devkit": "19.0.
|
|
67
|
-
"@nx/js": "19.0.
|
|
68
|
-
"@nrwl/webpack": "19.0.
|
|
66
|
+
"@nx/devkit": "19.0.5",
|
|
67
|
+
"@nx/js": "19.0.5",
|
|
68
|
+
"@nrwl/webpack": "19.0.5"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
@@ -15,7 +15,7 @@ async function webpackInitGeneratorInternal(tree, schema) {
|
|
|
15
15
|
nxJson.useInferencePlugins !== false;
|
|
16
16
|
schema.addPlugin ??= addPluginDefault;
|
|
17
17
|
if (schema.addPlugin) {
|
|
18
|
-
await (0, add_plugin_1.addPlugin)(tree, '@nx/webpack/plugin', plugin_1.createNodes, {
|
|
18
|
+
await (0, add_plugin_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/webpack/plugin', plugin_1.createNodes, {
|
|
19
19
|
buildTargetName: [
|
|
20
20
|
'build',
|
|
21
21
|
'webpack:build',
|
|
@@ -152,6 +152,19 @@ function applyNxIndependentConfig(options, config) {
|
|
|
152
152
|
moduleTrace: !!options.verbose,
|
|
153
153
|
usedExports: !!options.verbose,
|
|
154
154
|
};
|
|
155
|
+
/**
|
|
156
|
+
* Initialize properties that get set when webpack is used during task execution.
|
|
157
|
+
* These properties may be used by consumers who expect them to not be undefined.
|
|
158
|
+
*
|
|
159
|
+
* When @nx/webpack/plugin resolves the config, it is not during a task, and therefore
|
|
160
|
+
* these values are not set, which can lead to errors being thrown when reading
|
|
161
|
+
* the webpack options from the resolved file.
|
|
162
|
+
*/
|
|
163
|
+
config.entry ??= {};
|
|
164
|
+
config.resolve ??= {};
|
|
165
|
+
config.module ??= {};
|
|
166
|
+
config.plugins ??= [];
|
|
167
|
+
config.externals ??= [];
|
|
155
168
|
}
|
|
156
169
|
function applyNxDependentConfig(options, config, { useNormalizedEntry } = {}) {
|
|
157
170
|
const tsConfig = options.tsConfig ?? (0, js_1.getRootTsConfigPath)();
|
|
@@ -9,12 +9,14 @@ function generateEntryPoints(appConfig) {
|
|
|
9
9
|
// remove duplicates
|
|
10
10
|
return [...new Set(entryPoints)];
|
|
11
11
|
};
|
|
12
|
+
const styleEntryPoints = appConfig.styles.filter((style) => !(typeof style !== 'string' && !style.inject));
|
|
13
|
+
const scriptEntryPoints = appConfig.scripts.filter((script) => !(typeof script !== 'string' && !script.inject));
|
|
12
14
|
const entryPoints = [
|
|
13
15
|
'runtime',
|
|
14
16
|
'polyfills',
|
|
15
17
|
'sw-register',
|
|
16
|
-
...extraEntryPoints(
|
|
17
|
-
...extraEntryPoints(
|
|
18
|
+
...extraEntryPoints(styleEntryPoints, 'styles'),
|
|
19
|
+
...extraEntryPoints(scriptEntryPoints, 'scripts'),
|
|
18
20
|
'vendor',
|
|
19
21
|
'main',
|
|
20
22
|
];
|