@nx/next 22.4.1 → 22.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/next",
3
- "version": "22.4.1",
3
+ "version": "22.4.2",
4
4
  "private": false,
5
5
  "description": "The Next.js plugin for Nx contains executors and generators for managing Next.js applications and libraries within an Nx workspace. It provides:\n\n\n- Scaffolding for creating, building, serving, linting, and testing Next.js applications.\n\n- Integration with building, serving, and exporting a Next.js application.\n\n- Integration with React libraries within the workspace. \n\nWhen using Next.js in Nx, you get the out-of-the-box support for TypeScript, Playwright, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.",
6
6
  "repository": {
@@ -35,26 +35,25 @@
35
35
  "next": ">=14.0.0 <17.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "22.4.1",
38
+ "@nx/devkit": "22.4.2",
39
39
  "@babel/plugin-proposal-decorators": "^7.22.7",
40
40
  "@svgr/webpack": "^8.1.0",
41
41
  "copy-webpack-plugin": "^10.2.4",
42
- "file-loader": "^6.2.0",
43
42
  "ignore": "^5.0.4",
44
43
  "semver": "^7.6.3",
45
44
  "tslib": "^2.3.0",
46
45
  "webpack-merge": "^5.8.0",
47
- "@nx/js": "22.4.1",
48
- "@nx/eslint": "22.4.1",
49
- "@nx/react": "22.4.1",
50
- "@nx/web": "22.4.1",
51
- "@nx/webpack": "22.4.1",
46
+ "@nx/js": "22.4.2",
47
+ "@nx/eslint": "22.4.2",
48
+ "@nx/react": "22.4.2",
49
+ "@nx/web": "22.4.2",
50
+ "@nx/webpack": "22.4.2",
52
51
  "@phenomnomnominal/tsquery": "~6.1.4"
53
52
  },
54
53
  "devDependencies": {
55
- "@nx/cypress": "22.4.1",
56
- "@nx/playwright": "22.4.1",
57
- "nx": "22.4.1"
54
+ "@nx/cypress": "22.4.2",
55
+ "@nx/playwright": "22.4.2",
56
+ "nx": "22.4.2"
58
57
  },
59
58
  "publishConfig": {
60
59
  "access": "public"
@@ -1,3 +1,3 @@
1
1
  import { type Tree } from '@nx/devkit';
2
- export default function addSvgrToNextConfig(tree: Tree): Promise<import("@nx/devkit").GeneratorCallback>;
2
+ export default function addSvgrToNextConfig(tree: Tree): Promise<void>;
3
3
  //# sourceMappingURL=add-svgr-to-next-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-svgr-to-next-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-22-0-0/add-svgr-to-next-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAQV,MAAM,YAAY,CAAC;AAKpB,wBAA8B,mBAAmB,CAAC,IAAI,EAAE,IAAI,mDA6Q3D"}
1
+ {"version":3,"file":"add-svgr-to-next-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/next/src/migrations/update-22-0-0/add-svgr-to-next-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAMV,MAAM,YAAY,CAAC;AAKpB,wBAA8B,mBAAmB,CAAC,IAAI,EAAE,IAAI,iBAyQ3D"}
@@ -145,27 +145,32 @@ async function addSvgrToNextConfig(tree) {
145
145
  const originalWebpack = config.webpack;
146
146
  // @ts-ignore
147
147
  config.webpack = (webpackConfig, ctx) => {
148
- // Add SVGR support
148
+ // Add SVGR support with webpack 5 asset modules
149
149
  webpackConfig.module.rules.push({
150
150
  test: /\.svg$/,
151
- issuer: { not: /\.(css|scss|sass)$/ },
152
- resourceQuery: {
153
- not: [
154
- /__next_metadata__/,
155
- /__next_metadata_route__/,
156
- /__next_metadata_image_meta__/,
157
- ],
158
- },
159
- use: [
151
+ oneOf: [
160
152
  {
161
- loader: require.resolve('@svgr/webpack'),
162
- options: ${svgrOptions},
153
+ resourceQuery: /url/,
154
+ type: 'asset/resource',
155
+ generator: {
156
+ filename: 'static/media/[name].[hash][ext]',
157
+ },
163
158
  },
164
159
  {
165
- loader: require.resolve('file-loader'),
166
- options: {
167
- name: 'static/media/[name].[hash].[ext]',
160
+ issuer: { not: /\.(css|scss|sass)$/ },
161
+ resourceQuery: {
162
+ not: [
163
+ /__next_metadata__/,
164
+ /__next_metadata_route__/,
165
+ /__next_metadata_image_meta__/,
166
+ ],
168
167
  },
168
+ use: [
169
+ {
170
+ loader: require.resolve('@svgr/webpack'),
171
+ options: ${svgrOptions},
172
+ },
173
+ ],
169
174
  },
170
175
  ],
171
176
  });
@@ -202,8 +207,4 @@ async function addSvgrToNextConfig(tree) {
202
207
  tree.write(nextConfigPath, content);
203
208
  }
204
209
  await (0, devkit_1.formatFiles)(tree);
205
- // Add file-loader as a dev dependency since it's now required for SVGR
206
- return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
207
- 'file-loader': '^6.2.0',
208
- });
209
210
  }