@nx/next 18.0.4 → 18.1.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.
Files changed (2) hide show
  1. package/package.json +9 -9
  2. package/plugins/with-nx.js +13 -33
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/next",
3
- "version": "18.0.4",
3
+ "version": "18.1.0-beta.0",
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, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.",
6
6
  "repository": {
@@ -34,7 +34,7 @@
34
34
  "next": ">=14.0.0"
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "18.0.4",
37
+ "@nx/devkit": "18.1.0-beta.0",
38
38
  "@babel/plugin-proposal-decorators": "^7.22.7",
39
39
  "@svgr/webpack": "^8.0.1",
40
40
  "chalk": "^4.1.0",
@@ -45,13 +45,13 @@
45
45
  "url-loader": "^4.1.1",
46
46
  "tslib": "^2.3.0",
47
47
  "webpack-merge": "^5.8.0",
48
- "@nx/js": "18.0.4",
49
- "@nx/eslint": "18.0.4",
50
- "@nx/react": "18.0.4",
51
- "@nx/web": "18.0.4",
52
- "@nx/webpack": "18.0.4",
53
- "@nx/workspace": "18.0.4",
54
- "@nrwl/next": "18.0.4"
48
+ "@nx/js": "18.1.0-beta.0",
49
+ "@nx/eslint": "18.1.0-beta.0",
50
+ "@nx/react": "18.1.0-beta.0",
51
+ "@nx/web": "18.1.0-beta.0",
52
+ "@nx/webpack": "18.1.0-beta.0",
53
+ "@nx/workspace": "18.1.0-beta.0",
54
+ "@nrwl/next": "18.1.0-beta.0"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public"
@@ -219,39 +219,19 @@ function getNextConfig(nextConfig = {}, context = getWithNxContext()) {
219
219
  */
220
220
  // Default SVGR support to be on for projects.
221
221
  if (nx?.svgr !== false) {
222
- config.module.rules.push({
223
- test: /\.svg$/,
224
- oneOf: [
225
- // If coming from JS/TS file, then transform into React component using SVGR.
226
- {
227
- issuer: /\.[jt]sx?$/,
228
- use: [
229
- {
230
- loader: require.resolve('@svgr/webpack'),
231
- options: {
232
- svgo: false,
233
- titleProp: true,
234
- ref: true,
235
- },
236
- },
237
- {
238
- loader: require.resolve('url-loader'),
239
- options: {
240
- limit: 10000, // 10kB
241
- name: '[name].[hash:7].[ext]',
242
- },
243
- },
244
- ],
245
- },
246
- // Fallback to plain URL loader if someone just imports the SVG and references it on the <img src> tag
247
- {
248
- loader: require.resolve('url-loader'),
249
- options: {
250
- limit: 10000, // 10kB
251
- name: '[name].[hash:7].[ext]',
252
- },
253
- },
254
- ],
222
+ config.module.rules.push(
223
+ // Apply rule for svg imports ending in ?url
224
+ {
225
+ test: /\.svg$/i,
226
+ type: 'asset',
227
+ resourceQuery: /url/, // apply to *.svg?url
228
+ },
229
+ // Convert all other svg imports to React components
230
+ {
231
+ test: /\.svg$/i,
232
+ issuer: /\.[jt]sx?$/,
233
+ resourceQuery: { not: [/url/] },
234
+ use: ['@svgr/webpack'],
255
235
  });
256
236
  }
257
237
  return userWebpack(config, options);