@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 CHANGED
@@ -40,6 +40,15 @@
40
40
  "alwaysAddToPackageJson": false
41
41
  }
42
42
  }
43
+ },
44
+ "16.4.1": {
45
+ "version": "16.4.1-beta.0",
46
+ "packages": {
47
+ "webpack": {
48
+ "version": "^5.80.0",
49
+ "alwaysAddToPackageJson": false
50
+ }
51
+ }
43
52
  }
44
53
  }
45
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/webpack",
3
- "version": "16.4.0",
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.4.0",
34
- "@nx/devkit": "16.4.0",
35
- "@nx/js": "16.4.0",
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": "ae698a72748d9f33aa5395aeeaa7b7af436a1dc5"
78
+ "gitHead": "376d656cfc7f6390ff1cd6d9de348baf7bccbf33"
80
79
  }
@@ -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|png|jpe?g|gif|webp|avif)$/,
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|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)$/,
323
- loader: require.resolve('file-loader'),
324
- options: {
325
- name: `[name]${hashFormat.file}.[ext]`,
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,