@nx/webpack 22.0.0-beta.0 → 22.0.0-beta.2

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
@@ -1,11 +1,5 @@
1
1
  {
2
2
  "generators": {
3
- "update-19-6-3-proxy-config": {
4
- "cli": "nx",
5
- "version": "19.6.3-beta.0",
6
- "description": "Migrate proxy config files to match new format from webpack-dev-server v5.",
7
- "implementation": "./src/migrations/update-19-6-3/proxy-config"
8
- },
9
3
  "update-21-0-0-remove-isolated-config": {
10
4
  "cli": "nx",
11
5
  "version": "21.0.0-beta.11",
@@ -20,28 +14,6 @@
20
14
  }
21
15
  },
22
16
  "packageJsonUpdates": {
23
- "19.6.0": {
24
- "version": "19.6.0-beta.1",
25
- "packages": {
26
- "webpack-dev-server": {
27
- "version": "^5.0.4",
28
- "alwaysAddToPackageJson": false
29
- }
30
- }
31
- },
32
- "19.7.0": {
33
- "version": "19.7.0-beta.4",
34
- "packages": {
35
- "@module-federation/enhanced": {
36
- "version": "~0.6.0",
37
- "alwaysAddToPackageJson": false
38
- },
39
- "@module-federation/sdk": {
40
- "version": "~0.6.0",
41
- "alwaysAddToPackageJson": false
42
- }
43
- }
44
- },
45
17
  "20.5.0": {
46
18
  "version": "20.5.0-beta.3",
47
19
  "packages": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/webpack",
3
- "version": "22.0.0-beta.0",
3
+ "version": "22.0.0-beta.2",
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": {
@@ -64,11 +64,11 @@
64
64
  "webpack-dev-server": "^5.2.1",
65
65
  "webpack-node-externals": "^3.0.0",
66
66
  "webpack-subresource-integrity": "^5.1.0",
67
- "@nx/devkit": "22.0.0-beta.0",
68
- "@nx/js": "22.0.0-beta.0"
67
+ "@nx/devkit": "22.0.0-beta.2",
68
+ "@nx/js": "22.0.0-beta.2"
69
69
  },
70
70
  "devDependencies": {
71
- "nx": "22.0.0-beta.0"
71
+ "nx": "22.0.0-beta.2"
72
72
  },
73
73
  "publishConfig": {
74
74
  "access": "public"
@@ -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,CA6VN"}
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,CAkVN"}
@@ -296,20 +296,9 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
296
296
  ...config.module,
297
297
  rules: [
298
298
  ...(config.module.rules ?? []),
299
- // Images: Inline small images, and emit a separate file otherwise.
299
+ // Images: Inline small images, and emit a separate file otherwise (including SVGs).
300
300
  {
301
- test: /\.(avif|bmp|gif|ico|jpe?g|png|webp)$/,
302
- type: 'asset',
303
- parser: {
304
- dataUrlCondition: {
305
- maxSize: 10_000, // 10 kB
306
- },
307
- },
308
- },
309
- // TODO(v22): Remove this but provide a migration in `@nx/react` to add @svgr/webpack in userland webpack config
310
- // SVG: same as image but we need to separate it so it can be swapped for SVGR in the React plugin.
311
- {
312
- test: /\.svg$/,
301
+ test: /\.(avif|bmp|gif|ico|jpe?g|png|svg|webp)$/,
313
302
  type: 'asset',
314
303
  parser: {
315
304
  dataUrlCondition: {
@@ -1,3 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function update(tree: Tree): Promise<void>;
3
- //# sourceMappingURL=proxy-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxy-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/webpack/src/migrations/update-19-6-3/proxy-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,IAAI,EAAc,MAAM,YAAY,CAAC;AAItD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA2D9D"}
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = update;
4
- const devkit_1 = require("@nx/devkit");
5
- const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
6
- async function update(tree) {
7
- const unmigratedConfigs = [];
8
- const migrate = (options) => {
9
- if (!options.proxyConfig)
10
- return;
11
- if (options.proxyConfig.endsWith('.json')) {
12
- (0, devkit_1.updateJson)(tree, options.proxyConfig, (json) => {
13
- if (Array.isArray(json))
14
- return json;
15
- if (typeof json === 'object') {
16
- return Object.keys(json).map((context) => ({
17
- context: [context],
18
- ...json[context],
19
- }));
20
- }
21
- return json;
22
- });
23
- }
24
- else {
25
- // For non-JSON files, it's not possible to automatically update the proxy config
26
- // since its content can vary greatly.
27
- unmigratedConfigs.push(options.proxyConfig);
28
- }
29
- };
30
- (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nx/webpack:dev-server', migrate);
31
- // React dev-server calls Webpack dev-server.
32
- (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nx/react:module-federation-dev-server', migrate);
33
- if (unmigratedConfigs.length > 0) {
34
- devkit_1.logger.warn(`Some proxy config files need to be updated manually.
35
- ${unmigratedConfigs.join('\n ')}
36
-
37
- Webpack-dev-server v5 changed the proxy config schema to accept only an array.
38
-
39
- For example, if you had the following:
40
-
41
- "proxy": {
42
- "/api": {
43
- "target": "http://localhost:3000"
44
- }
45
- }
46
-
47
- It needs to be updated to:
48
-
49
- "proxy": [{
50
- "context": ["/api"],
51
- "target": "http://localhost:3000"
52
- }]
53
-
54
- More information: https://github.com/webpack/webpack-dev-server/blob/master/migration-v5.md
55
- `);
56
- }
57
- }