@nx/webpack 16.4.0 → 16.5.0-beta.0
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/migrations.json +9 -0
- package/package.json +5 -6
- package/src/utils/with-web.js +23 -5
package/migrations.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/webpack",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.5.0-beta.0",
|
|
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": {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/core": "^7.15.0",
|
|
33
|
-
"@nrwl/webpack": "16.
|
|
34
|
-
"@nx/devkit": "16.
|
|
35
|
-
"@nx/js": "16.
|
|
33
|
+
"@nrwl/webpack": "16.5.0-beta.0",
|
|
34
|
+
"@nx/devkit": "16.5.0-beta.0",
|
|
35
|
+
"@nx/js": "16.5.0-beta.0",
|
|
36
36
|
"autoprefixer": "^10.4.9",
|
|
37
37
|
"babel-loader": "^9.1.2",
|
|
38
38
|
"browserslist": "^4.21.4",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"css-loader": "^6.4.0",
|
|
43
43
|
"css-minimizer-webpack-plugin": "^5.0.0",
|
|
44
44
|
"dotenv": "~10.0.0",
|
|
45
|
-
"file-loader": "^6.2.0",
|
|
46
45
|
"fork-ts-checker-webpack-plugin": "7.2.13",
|
|
47
46
|
"ignore": "^5.0.4",
|
|
48
47
|
"less": "4.1.3",
|
|
@@ -76,5 +75,5 @@
|
|
|
76
75
|
"access": "public"
|
|
77
76
|
},
|
|
78
77
|
"types": "./index.d.ts",
|
|
79
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "376d656cfc7f6390ff1cd6d9de348baf7bccbf33"
|
|
80
79
|
}
|
package/src/utils/with-web.js
CHANGED
|
@@ -309,20 +309,38 @@ function withWeb(pluginOptions = {}) {
|
|
|
309
309
|
config.resolve.mainFields = ['browser', 'module', 'main'];
|
|
310
310
|
config.module = Object.assign(Object.assign({}, config.module), { rules: [
|
|
311
311
|
...((_c = config.module.rules) !== null && _c !== void 0 ? _c : []),
|
|
312
|
+
// Images: Inline small images, and emit a separate file otherwise.
|
|
312
313
|
{
|
|
313
|
-
test: /\.(bmp|
|
|
314
|
+
test: /\.(avif|bmp|gif|ico|jpe?g|png|webp)$/,
|
|
314
315
|
type: 'asset',
|
|
315
316
|
parser: {
|
|
316
317
|
dataUrlCondition: {
|
|
317
318
|
maxSize: 10000, // 10 kB
|
|
318
319
|
},
|
|
319
320
|
},
|
|
321
|
+
generator: {
|
|
322
|
+
filename: `[name]${hashFormat.file}[ext]`,
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
// SVG: same as image but we need to separate it so it can be swapped for SVGR in the React plugin.
|
|
326
|
+
{
|
|
327
|
+
test: /\.svg$/,
|
|
328
|
+
type: 'asset',
|
|
329
|
+
parser: {
|
|
330
|
+
dataUrlCondition: {
|
|
331
|
+
maxSize: 10000, // 10 kB
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
generator: {
|
|
335
|
+
filename: `[name]${hashFormat.file}[ext]`,
|
|
336
|
+
},
|
|
320
337
|
},
|
|
338
|
+
// Fonts: Emit separate file and export the URL.
|
|
321
339
|
{
|
|
322
|
-
test: /\.(eot|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
340
|
+
test: /\.(eot|otf|ttf|woff|woff2)$/,
|
|
341
|
+
type: 'asset/resource',
|
|
342
|
+
generator: {
|
|
343
|
+
filename: `[name]${hashFormat.file}[ext]`,
|
|
326
344
|
},
|
|
327
345
|
},
|
|
328
346
|
...rules,
|