@nx/webpack 17.2.0-beta.12 → 17.2.0-beta.15
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": "17.2.0-beta.
|
|
3
|
+
"version": "17.2.0-beta.15",
|
|
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": {
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"webpack-dev-server": "^4.9.3",
|
|
63
63
|
"webpack-node-externals": "^3.0.0",
|
|
64
64
|
"webpack-subresource-integrity": "^5.1.0",
|
|
65
|
-
"@nx/devkit": "17.2.0-beta.
|
|
66
|
-
"@nx/js": "17.2.0-beta.
|
|
67
|
-
"@nrwl/webpack": "17.2.0-beta.
|
|
65
|
+
"@nx/devkit": "17.2.0-beta.15",
|
|
66
|
+
"@nx/js": "17.2.0-beta.15",
|
|
67
|
+
"@nrwl/webpack": "17.2.0-beta.15"
|
|
68
68
|
},
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
@@ -69,6 +69,10 @@ function applyNxIndependentConfig(options, config) {
|
|
|
69
69
|
: false;
|
|
70
70
|
config.output = {
|
|
71
71
|
...config.output,
|
|
72
|
+
libraryTarget: (config.output?.libraryTarget ??
|
|
73
|
+
options.target === 'node')
|
|
74
|
+
? 'commonjs'
|
|
75
|
+
: undefined,
|
|
72
76
|
path: config.output?.path ??
|
|
73
77
|
(options.outputPath
|
|
74
78
|
? path.join(options.root, options.outputPath)
|
package/src/plugins/plugin.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.createNodes = exports.createDependencies = void 0;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
7
|
-
const project_configuration_utils_1 = require("nx/src/project-graph/utils/project-configuration-utils");
|
|
8
7
|
const fs_1 = require("fs");
|
|
9
8
|
const read_webpack_options_1 = require("../utils/webpack/read-webpack-options");
|
|
10
9
|
const resolve_user_defined_webpack_config_1 = require("../utils/webpack/resolve-user-defined-webpack-config");
|
|
@@ -66,35 +65,25 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
|
|
|
66
65
|
const configBasename = (0, path_1.basename)(configFilePath);
|
|
67
66
|
targets[options.buildTargetName] = {
|
|
68
67
|
command: `webpack -c ${configBasename} --node-env=production`,
|
|
69
|
-
options: {
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
options: { cwd: projectRoot },
|
|
69
|
+
cache: true,
|
|
70
|
+
inputs: 'production' in namedInputs
|
|
71
|
+
? [
|
|
72
|
+
'default',
|
|
73
|
+
'^production',
|
|
74
|
+
{
|
|
75
|
+
externalDependencies: ['webpack-cli'],
|
|
76
|
+
},
|
|
77
|
+
]
|
|
78
|
+
: [
|
|
79
|
+
'default',
|
|
80
|
+
'^default',
|
|
81
|
+
{
|
|
82
|
+
externalDependencies: ['webpack-cli'],
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
outputs: [outputPath],
|
|
72
86
|
};
|
|
73
|
-
const buildTargetDefaults = (0, project_configuration_utils_1.readTargetDefaultsForTarget)(options.buildTargetName, context.nxJsonConfiguration.targetDefaults);
|
|
74
|
-
if (buildTargetDefaults?.cache === undefined) {
|
|
75
|
-
targets[options.buildTargetName].cache = true;
|
|
76
|
-
}
|
|
77
|
-
if (buildTargetDefaults?.inputs === undefined) {
|
|
78
|
-
targets[options.buildTargetName].inputs =
|
|
79
|
-
'production' in namedInputs
|
|
80
|
-
? [
|
|
81
|
-
'default',
|
|
82
|
-
'^production',
|
|
83
|
-
{
|
|
84
|
-
externalDependencies: ['webpack-cli'],
|
|
85
|
-
},
|
|
86
|
-
]
|
|
87
|
-
: [
|
|
88
|
-
'default',
|
|
89
|
-
'^default',
|
|
90
|
-
{
|
|
91
|
-
externalDependencies: ['webpack-cli'],
|
|
92
|
-
},
|
|
93
|
-
];
|
|
94
|
-
}
|
|
95
|
-
if (buildTargetDefaults?.outputs === undefined) {
|
|
96
|
-
targets[options.buildTargetName].outputs = [outputPath];
|
|
97
|
-
}
|
|
98
87
|
targets[options.serveTargetName] = {
|
|
99
88
|
command: `webpack serve -c ${configBasename} --node-env=development`,
|
|
100
89
|
options: {
|