@nx/webpack 18.2.0-beta.2 → 18.2.0-beta.3
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": "18.2.0-beta.
|
|
3
|
+
"version": "18.2.0-beta.3",
|
|
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": "18.2.0-beta.
|
|
67
|
-
"@nx/js": "18.2.0-beta.
|
|
68
|
-
"@nrwl/webpack": "18.2.0-beta.
|
|
66
|
+
"@nx/devkit": "18.2.0-beta.3",
|
|
67
|
+
"@nx/js": "18.2.0-beta.3",
|
|
68
|
+
"@nrwl/webpack": "18.2.0-beta.3"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
@@ -21,7 +21,8 @@ function normalizeOptions(options, root, projectRoot, sourceRoot) {
|
|
|
21
21
|
: options.optimization,
|
|
22
22
|
};
|
|
23
23
|
if (options.assets) {
|
|
24
|
-
normalizedOptions.assets = (0, normalize_options_1.normalizeAssets)(options.assets, root, sourceRoot, projectRoot
|
|
24
|
+
normalizedOptions.assets = (0, normalize_options_1.normalizeAssets)(options.assets, root, sourceRoot, projectRoot, false // executor assets are relative to workspace root for consistency
|
|
25
|
+
);
|
|
25
26
|
}
|
|
26
27
|
return normalizedOptions;
|
|
27
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AssetGlobPattern, FileReplacement, NormalizedNxWebpackPluginOptions, NxWebpackPluginOptions } from '../nx-webpack-plugin-options';
|
|
2
2
|
export declare function normalizeOptions(options: NxWebpackPluginOptions): NormalizedNxWebpackPluginOptions;
|
|
3
|
-
export declare function normalizeAssets(assets: any[], root: string, sourceRoot: string, projectRoot: string): AssetGlobPattern[];
|
|
3
|
+
export declare function normalizeAssets(assets: any[], root: string, sourceRoot: string, projectRoot: string, resolveRelativePathsToProjectRoot?: boolean): AssetGlobPattern[];
|
|
4
4
|
export declare function normalizeFileReplacements(root: string, fileReplacements: FileReplacement[]): FileReplacement[];
|
|
@@ -28,12 +28,14 @@ function normalizeOptions(options) {
|
|
|
28
28
|
if (configurationName) {
|
|
29
29
|
Object.assign(buildTargetOptions, targetConfig.configurations?.[configurationName]);
|
|
30
30
|
}
|
|
31
|
-
Object.assign(combinedPluginAndMaybeExecutorOptions,
|
|
32
|
-
)
|
|
31
|
+
Object.assign(combinedPluginAndMaybeExecutorOptions, options,
|
|
32
|
+
// executor options take precedence (especially for overriding with CLI args)
|
|
33
|
+
buildTargetOptions);
|
|
33
34
|
}
|
|
34
35
|
else {
|
|
35
|
-
Object.assign(combinedPluginAndMaybeExecutorOptions,
|
|
36
|
-
)
|
|
36
|
+
Object.assign(combinedPluginAndMaybeExecutorOptions, options,
|
|
37
|
+
// executor options take precedence (especially for overriding with CLI args)
|
|
38
|
+
originalTargetOptions);
|
|
37
39
|
}
|
|
38
40
|
const sourceRoot = projectNode.data.sourceRoot ?? projectNode.data.root;
|
|
39
41
|
if (!options.main) {
|
|
@@ -74,7 +76,7 @@ function normalizeOptions(options) {
|
|
|
74
76
|
};
|
|
75
77
|
}
|
|
76
78
|
exports.normalizeOptions = normalizeOptions;
|
|
77
|
-
function normalizeAssets(assets, root, sourceRoot, projectRoot) {
|
|
79
|
+
function normalizeAssets(assets, root, sourceRoot, projectRoot, resolveRelativePathsToProjectRoot = true) {
|
|
78
80
|
return assets.map((asset) => {
|
|
79
81
|
if (typeof asset === 'string') {
|
|
80
82
|
const assetPath = (0, devkit_1.normalizePath)(asset);
|
|
@@ -101,7 +103,7 @@ function normalizeAssets(assets, root, sourceRoot, projectRoot) {
|
|
|
101
103
|
}
|
|
102
104
|
const assetPath = (0, devkit_1.normalizePath)(asset.input);
|
|
103
105
|
let resolvedAssetPath = (0, path_1.resolve)(root, assetPath);
|
|
104
|
-
if (asset.input.startsWith('.')) {
|
|
106
|
+
if (resolveRelativePathsToProjectRoot && asset.input.startsWith('.')) {
|
|
105
107
|
const resolvedProjectRoot = (0, path_1.resolve)(root, projectRoot);
|
|
106
108
|
resolvedAssetPath = (0, path_1.resolve)(resolvedProjectRoot, assetPath);
|
|
107
109
|
}
|