@nx/webpack 23.0.0-beta.1 → 23.0.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 +7 -7
- package/src/generators/configuration/configuration.d.ts.map +1 -1
- package/src/generators/configuration/configuration.js +4 -1
- package/src/plugins/nx-webpack-plugin/lib/apply-web-config.d.ts.map +1 -1
- package/src/plugins/nx-webpack-plugin/lib/apply-web-config.js +3 -3
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +10 -1
- package/src/utils/webpack/deprecated-less-loader.js +19 -0
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.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": {
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"postcss-import": "~14.1.0",
|
|
53
53
|
"postcss-loader": "^8.2.1",
|
|
54
54
|
"rxjs": "^7.8.0",
|
|
55
|
-
"sass": "^1.
|
|
56
|
-
"sass-embedded": "^1.
|
|
57
|
-
"sass-loader": "^16.0.
|
|
55
|
+
"sass": "^1.97.2",
|
|
56
|
+
"sass-embedded": "^1.97.2",
|
|
57
|
+
"sass-loader": "^16.0.7",
|
|
58
58
|
"source-map-loader": "^5.0.0",
|
|
59
59
|
"style-loader": "^3.3.0",
|
|
60
60
|
"terser-webpack-plugin": "^5.3.3",
|
|
@@ -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.3",
|
|
69
|
+
"@nx/js": "23.0.0-beta.3"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"nx": "23.0.0-beta.
|
|
72
|
+
"nx": "23.0.0-beta.3"
|
|
73
73
|
},
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAMjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAMjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAOxD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,8BAGtC;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,8BAoCtC;AA6LD,eAAe,sBAAsB,CAAC"}
|
|
@@ -6,6 +6,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const init_1 = require("../init/init");
|
|
7
7
|
const has_plugin_1 = require("../../utils/has-plugin");
|
|
8
8
|
const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
|
|
9
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
9
10
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
10
11
|
function configurationGenerator(tree, options) {
|
|
11
12
|
return configurationGeneratorInternal(tree, { addPlugin: false, ...options });
|
|
@@ -127,7 +128,9 @@ module.exports = composePlugins(withNx(), (config) => {
|
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
function addBuildTarget(tree, options) {
|
|
130
|
-
(0, target_defaults_utils_1.addBuildTargetDefaults)(tree, '@nx/webpack:webpack'
|
|
131
|
+
(0, target_defaults_utils_1.addBuildTargetDefaults)(tree, '@nx/webpack:webpack', 'build', [
|
|
132
|
+
ts_solution_setup_1.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
|
|
133
|
+
]);
|
|
131
134
|
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
132
135
|
const buildOptions = {
|
|
133
136
|
target: options.target,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-web-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-web-config.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EAIb,wBAAwB,EAEzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAC;AAavF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,mCAAmC,EAC5C,MAAM,GAAE,OAAO,CAAC,wBAAwB,GAAG,aAAa,CAAM,EAC9D,EACE,kBAAkB,GACnB,GAAE;IAID,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACzB,GACL,IAAI,
|
|
1
|
+
{"version":3,"file":"apply-web-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/webpack/src/plugins/nx-webpack-plugin/lib/apply-web-config.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EAIb,wBAAwB,EAEzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAC;AAavF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,mCAAmC,EAC5C,MAAM,GAAE,OAAO,CAAC,wBAAwB,GAAG,aAAa,CAAM,EAC9D,EACE,kBAAkB,GACnB,GAAE;IAID,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACzB,GACL,IAAI,CA2VN"}
|
|
@@ -118,7 +118,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
118
118
|
use: [
|
|
119
119
|
...(0, stylesheet_loaders_1.getCommonLoadersForCssModules)(options, includePaths),
|
|
120
120
|
{
|
|
121
|
-
loader:
|
|
121
|
+
loader: path.join(__dirname, '../../../utils/webpack/deprecated-less-loader.js'),
|
|
122
122
|
options: {
|
|
123
123
|
lessOptions: {
|
|
124
124
|
paths: includePaths,
|
|
@@ -163,7 +163,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
163
163
|
use: [
|
|
164
164
|
...(0, stylesheet_loaders_1.getCommonLoadersForGlobalCss)(options, includePaths),
|
|
165
165
|
{
|
|
166
|
-
loader:
|
|
166
|
+
loader: path.join(__dirname, '../../../utils/webpack/deprecated-less-loader.js'),
|
|
167
167
|
options: {
|
|
168
168
|
sourceMap: !!options.sourceMap,
|
|
169
169
|
lessOptions: {
|
|
@@ -210,7 +210,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
210
210
|
use: [
|
|
211
211
|
...(0, stylesheet_loaders_1.getCommonLoadersForGlobalStyle)(options, includePaths),
|
|
212
212
|
{
|
|
213
|
-
loader:
|
|
213
|
+
loader: path.join(__dirname, '../../../utils/webpack/deprecated-less-loader.js'),
|
|
214
214
|
options: {
|
|
215
215
|
sourceMap: !!options.sourceMap,
|
|
216
216
|
lessOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAIlB,aAAa,EASd,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/webpack/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAIlB,aAAa,EASd,MAAM,YAAY,CAAC;AAgBpB,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;AAqBD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,oBAAoB,CAiC3D,CAAC;AAEF,eAAO,MAAM,aAAa,qCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -14,7 +14,14 @@ const read_webpack_options_1 = require("../utils/webpack/read-webpack-options");
|
|
|
14
14
|
const resolve_user_defined_webpack_config_1 = require("../utils/webpack/resolve-user-defined-webpack-config");
|
|
15
15
|
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
16
16
|
function readTargetsCache(cachePath) {
|
|
17
|
-
|
|
17
|
+
try {
|
|
18
|
+
return process.env.NX_CACHE_PROJECT_GRAPH !== 'false'
|
|
19
|
+
? (0, devkit_1.readJsonFile)(cachePath)
|
|
20
|
+
: {};
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
18
25
|
}
|
|
19
26
|
function writeTargetsToCache(cachePath, results) {
|
|
20
27
|
(0, devkit_1.writeJsonFile)(cachePath, results);
|
|
@@ -89,6 +96,7 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
|
|
|
89
96
|
{
|
|
90
97
|
externalDependencies: ['webpack-cli'],
|
|
91
98
|
},
|
|
99
|
+
ts_solution_setup_1.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
|
|
92
100
|
]
|
|
93
101
|
: [
|
|
94
102
|
'default',
|
|
@@ -96,6 +104,7 @@ async function createWebpackTargets(configFilePath, projectRoot, options, contex
|
|
|
96
104
|
{
|
|
97
105
|
externalDependencies: ['webpack-cli'],
|
|
98
106
|
},
|
|
107
|
+
ts_solution_setup_1.TS_SOLUTION_SETUP_TSCONFIG_INPUT,
|
|
99
108
|
],
|
|
100
109
|
outputs,
|
|
101
110
|
metadata: {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const lessLoader = require('less-loader');
|
|
2
|
+
|
|
3
|
+
module.exports = function (...args) {
|
|
4
|
+
if (!process.env.__NX_LESS_DEPRECATION_WARNED) {
|
|
5
|
+
process.env.__NX_LESS_DEPRECATION_WARNED = '1';
|
|
6
|
+
console.warn(
|
|
7
|
+
'\n⚠️ Less support in Nx is deprecated and will be removed in a future version.\n' +
|
|
8
|
+
' Please migrate to CSS or SCSS.\n' +
|
|
9
|
+
' Existing .less imports continue to compile, but Nx generators no longer\n' +
|
|
10
|
+
' accept --style=less. To add new Less files, install less-loader manually\n' +
|
|
11
|
+
' and generate with --style=css, then rename the file to .less.\n'
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
return lessLoader.apply(this, args);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
if (lessLoader.raw) {
|
|
18
|
+
module.exports.raw = lessLoader.raw;
|
|
19
|
+
}
|