@nx/rspack 22.7.0-pr.35019.f500fd7 → 22.7.0-rc.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nx/rspack",
3
3
  "description": "The Nx Plugin for Rspack contains executors and generators that support building applications using Rspack.",
4
- "version": "22.7.0-pr.35019.f500fd7",
4
+ "version": "22.7.0-rc.0",
5
5
  "type": "commonjs",
6
6
  "repository": {
7
7
  "type": "git",
@@ -24,10 +24,10 @@
24
24
  "generators": "./generators.json",
25
25
  "executors": "./executors.json",
26
26
  "dependencies": {
27
- "@nx/devkit": "22.7.0-pr.35019.f500fd7",
28
- "@nx/js": "22.7.0-pr.35019.f500fd7",
29
- "@nx/module-federation": "22.7.0-pr.35019.f500fd7",
30
- "@nx/web": "22.7.0-pr.35019.f500fd7",
27
+ "@nx/devkit": "22.7.0-rc.0",
28
+ "@nx/js": "22.7.0-rc.0",
29
+ "@nx/module-federation": "22.7.0-rc.0",
30
+ "@nx/web": "22.7.0-rc.0",
31
31
  "@phenomnomnominal/tsquery": "~6.1.4",
32
32
  "@rspack/core": "1.6.8",
33
33
  "@rspack/dev-server": "^1.1.4",
@@ -57,11 +57,11 @@
57
57
  "webpack-node-externals": "^3.0.0"
58
58
  },
59
59
  "devDependencies": {
60
- "nx": "22.7.0-pr.35019.f500fd7",
61
- "@nx/nest": "22.7.0-pr.35019.f500fd7"
60
+ "nx": "22.7.0-rc.0",
61
+ "@nx/nest": "22.7.0-rc.0"
62
62
  },
63
63
  "peerDependencies": {
64
- "@module-federation/enhanced": "^2.1.0",
64
+ "@module-federation/enhanced": "^2.3.3",
65
65
  "@module-federation/node": "^2.7.21"
66
66
  },
67
67
  "nx-migrations": {
@@ -69,6 +69,5 @@
69
69
  },
70
70
  "publishConfig": {
71
71
  "access": "public"
72
- },
73
- "types": "./src/index.d.ts"
72
+ }
74
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"module-federation-static-server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/executors/module-federation-static-server/module-federation-static-server.impl.ts"],"names":[],"mappings":"AAaA,OAAO,EAIL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAMzC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAE1F,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAiJ9D,wBAAgB,YAAY,CAC1B,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gCAAgC,EAClD,oBAAoB,EAAE,MAAM,EAC5B,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChD,UAAU,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,QAoEvD;AAED,wBAA+B,4BAA4B,CACzD,MAAM,EAAE,kCAAkC,EAC1C,OAAO,EAAE,eAAe;;;aA+IzB"}
1
+ {"version":3,"file":"module-federation-static-server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/executors/module-federation-static-server/module-federation-static-server.impl.ts"],"names":[],"mappings":"AAaA,OAAO,EAIL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAMzC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAE1F,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAgJ9D,wBAAgB,YAAY,CAC1B,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gCAAgC,EAClD,oBAAoB,EAAE,MAAM,EAC5B,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChD,UAAU,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,QAmEvD;AAED,wBAA+B,4BAA4B,CACzD,MAAM,EAAE,kCAAkC,EAC1C,OAAO,EAAE,eAAe;;;aA+IzB"}
@@ -50,9 +50,7 @@ async function buildHost(nxBin, buildTarget, context) {
50
50
  stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
51
51
  });
52
52
  staticProcess.stdout.on('data', (data) => {
53
- const ANSII_CODE_REGEX =
54
- // eslint-disable-next-line no-control-regex
55
- /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
53
+ const ANSII_CODE_REGEX = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
56
54
  const stdoutString = data.toString().replace(ANSII_CODE_REGEX, '');
57
55
  // in addition to writing into the stdout stream, also show error directly in console
58
56
  // so the error is easily discoverable. 'ERROR in' is the key word to search in webpack output.
@@ -105,9 +103,7 @@ function moveToTmpDirectory(staticRemotesConfig, hostOutputPath, hostUrlSegment)
105
103
  return commonOutputDirectory;
106
104
  }
107
105
  function startProxies(staticRemotesConfig, hostServeOptions, mappedLocationOfHost, mappedLocationsOfRemotes, sslOptions) {
108
- // eslint-disable-next-line @typescript-eslint/no-var-requires
109
106
  const { createProxyMiddleware } = require('http-proxy-middleware');
110
- // eslint-disable-next-line @typescript-eslint/no-var-requires
111
107
  const express = require('express');
112
108
  let sslCert;
113
109
  let sslKey;
@@ -121,9 +117,7 @@ function startProxies(staticRemotesConfig, hostServeOptions, mappedLocationOfHos
121
117
  devkit_1.logger.warn(`Attempted to find '${sslOptions.pathToCert}' and '${sslOptions.pathToKey}'.`);
122
118
  }
123
119
  }
124
- // eslint-disable-next-line @typescript-eslint/no-var-requires
125
120
  const http = require('http');
126
- // eslint-disable-next-line @typescript-eslint/no-var-requires
127
121
  const https = require('https');
128
122
  devkit_1.logger.info(`NX Starting static remotes proxies...`);
129
123
  for (const app of staticRemotesConfig.remotes) {
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAapB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,mBAAmB,8BA0G5B;AAED,eAAe,mBAAmB,CAAC;AAEnC,eAAO,MAAM,mBAAmB,sFAA0C,CAAC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAapB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,mBAAmB,8BAyG5B;AAED,eAAe,mBAAmB,CAAC;AAEnC,eAAO,MAAM,mBAAmB,sFAA0C,CAAC"}
@@ -69,7 +69,6 @@ async function rspackInitGenerator(tree, schema) {
69
69
  }
70
70
  : {}),
71
71
  };
72
- // eslint-disable-next-line @typescript-eslint/no-var-requires
73
72
  const version = require('../../../package.json').version;
74
73
  if (version !== '0.0.1') {
75
74
  // Ignored for local dev / e2e tests.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EAMd,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAuBD,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CA4B5D,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EAMd,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAqBD,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAgC5D,CAAC"}
@@ -13,7 +13,6 @@ const path_1 = require("path");
13
13
  const read_rspack_options_1 = require("../utils/read-rspack-options");
14
14
  const resolve_user_defined_rspack_config_1 = require("../utils/resolve-user-defined-rspack-config");
15
15
  const util_1 = require("@nx/js/src/plugins/typescript/util");
16
- const pmc = (0, package_manager_1.getPackageManagerCommand)();
17
16
  function readTargetsCache(cachePath) {
18
17
  try {
19
18
  return process.env.NX_CACHE_PROJECT_GRAPH !== 'false'
@@ -39,15 +38,16 @@ exports.createNodesV2 = [
39
38
  const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `rspack-${optionsHash}.hash`);
40
39
  const targetsCache = readTargetsCache(cachePath);
41
40
  const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
41
+ const pmc = (0, package_manager_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
42
42
  try {
43
- return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isTsSolutionSetup), configFilePaths, options, context);
43
+ return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isTsSolutionSetup, pmc), configFilePaths, options, context);
44
44
  }
45
45
  finally {
46
46
  writeTargetsToCache(cachePath, targetsCache);
47
47
  }
48
48
  },
49
49
  ];
50
- async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup) {
50
+ async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, pmc) {
51
51
  const projectRoot = (0, path_1.dirname)(configFilePath);
52
52
  // Do not create a project if package.json and project.json isn't there.
53
53
  const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
@@ -70,7 +70,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
70
70
  // We do not want to alter how the hash is calculated, so appending the config file path to the hash
71
71
  // to prevent vite/vitest files overwriting the target cache created by the other
72
72
  const hash = `${nodeHash}_${configFilePath}`;
73
- targetsCache[hash] ??= await createRspackTargets(configFilePath, projectRoot, normalizedOptions, context, isTsSolutionSetup);
73
+ targetsCache[hash] ??= await createRspackTargets(configFilePath, projectRoot, normalizedOptions, context, isTsSolutionSetup, pmc);
74
74
  const { targets, metadata } = targetsCache[hash];
75
75
  return {
76
76
  projects: {
@@ -82,7 +82,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
82
82
  },
83
83
  };
84
84
  }
85
- async function createRspackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup) {
85
+ async function createRspackTargets(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc) {
86
86
  const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
87
87
  const rspackConfig = await (0, resolve_user_defined_rspack_config_1.resolveUserDefinedRspackConfig)((0, path_1.join)(context.workspaceRoot, configFilePath), (0, js_1.getRootTsConfigPath)(), true);
88
88
  const rspackOptions = await (0, read_rspack_options_1.readRspackOptions)(rspackConfig);
@@ -1 +1 @@
1
- {"version":3,"file":"nx-tsconfig-paths-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/rspack/src/plugins/utils/plugins/nx-tsconfig-paths-rspack-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC7B,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,kCAAkC,EAAE,MAAM,WAAW,CAAC;AAI/D,qBAAa,2BAA2B;IAG1B,OAAO,CAAC,OAAO;IAF3B,OAAO,CAAC,eAAe,CAAS;gBAEZ,OAAO,EAAE,kCAAkC;IAO/D,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAqB/B,sBAAsB;IAUtB,yBAAyB,CACvB,MAAM,EAAE,OAAO,CAAC,uBAAuB,GAAG,aAAa,CAAC,EACxD,OAAO,KAAA,GACN,IAAI;CAuCR"}
1
+ {"version":3,"file":"nx-tsconfig-paths-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/rspack/src/plugins/utils/plugins/nx-tsconfig-paths-rspack-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC7B,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,kCAAkC,EAAE,MAAM,WAAW,CAAC;AAI/D,qBAAa,2BAA2B;IAG1B,OAAO,CAAC,OAAO;IAF3B,OAAO,CAAC,eAAe,CAAS;gBAEZ,OAAO,EAAE,kCAAkC;IAO/D,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAqB/B,sBAAsB;IAUtB,yBAAyB,CACvB,MAAM,EAAE,OAAO,CAAC,uBAAuB,GAAG,aAAa,CAAC,EACxD,OAAO,KAAA,GACN,IAAI;CAsCR"}
@@ -44,8 +44,7 @@ class NxTsconfigPathsRspackPlugin {
44
44
  if (!options.buildLibsFromSource && options.targetName) {
45
45
  const remappedTarget = options.targetName === 'serve' ? 'build' : options.targetName;
46
46
  const { target, dependencies } = (0, buildable_libs_utils_1.calculateProjectBuildableDependencies)(undefined, options.projectGraph, options.root, options.projectName, remappedTarget, options.configurationName);
47
- options.tsConfig = (0, buildable_libs_utils_1.createTmpTsConfig)(options.tsConfig, options.root, target.data.root, dependencies, true // There is an issue with Rspack that requires the baseUrl to be set in the generated tsconfig
48
- );
47
+ options.tsConfig = (0, buildable_libs_utils_1.createTmpTsConfig)(options.tsConfig, options.root, target.data.root, dependencies);
49
48
  this.tmpTsConfigPath = options.tsConfig;
50
49
  if (options.targetName === 'serve') {
51
50
  const buildableDependencies = dependencies
@@ -1 +1 @@
1
- {"version":3,"file":"generator-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/generator-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,mBAAmB,EACnB,IAAI,EAEL,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG3D,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AACvC,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC3D,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AACrE,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAKnE,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE;IACP,CAAC,UAAU,EAA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,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;CAChD,GACA;IAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAA;CAAE,CAmEnD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,UASrE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,UAYzE"}
@@ -442,7 +442,6 @@ async function handleUnsupportedUserProvidedTargetsErrors(userProvidedTargetName
442
442
  Please note that converting a potentially non-compatible project to use Vite may result in unexpected behavior. Always commit
443
443
  your changes before converting a project to use Vite, and test the converted project thoroughly before deploying it.
444
444
  `);
445
- // eslint-disable-next-line @typescript-eslint/no-var-requires
446
445
  const { Confirm } = require('enquirer');
447
446
  const prompt = new Confirm({
448
447
  name: 'question',
@@ -472,7 +471,6 @@ async function handleUnknownExecutors(projectName) {
472
471
  If you still want to convert your project to use the @nx/rspack executors,
473
472
  please make sure to commit your changes before running this generator.
474
473
  `);
475
- // eslint-disable-next-line @typescript-eslint/no-var-requires
476
474
  const { Confirm } = require('enquirer');
477
475
  const prompt = new Confirm({
478
476
  name: 'question',
@@ -489,7 +487,6 @@ async function handleUnknownExecutors(projectName) {
489
487
  }
490
488
  function determineFrameworkAndTarget(tree, options, projectRoot, targets) {
491
489
  (0, ensure_typescript_1.ensureTypescript)();
492
- // eslint-disable-next-line @typescript-eslint/no-var-requires
493
490
  const { ast, query } = require('@phenomnomnominal/tsquery');
494
491
  // First try to infer if the target is node
495
492
  if (options.target !== 'node') {
package/project.json DELETED
@@ -1,39 +0,0 @@
1
- {
2
- "name": "rspack",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/rspack/src",
5
- "projectType": "library",
6
- "targets": {
7
- "build": {
8
- "outputs": ["{workspaceRoot}/dist/packages/rspack/README.md"],
9
- "command": "node ./scripts/copy-readme.js rspack"
10
- },
11
- "legacy-post-build": {
12
- "executor": "@nx/workspace-plugin:legacy-post-build",
13
- "options": {
14
- "tsConfig": "./tsconfig.lib.json",
15
- "assets": [
16
- "packages/rspack/*.md",
17
- {
18
- "input": "./packages/rspack/src",
19
- "glob": "**/!(*.ts)",
20
- "output": "./src"
21
- },
22
- {
23
- "input": "./packages/rspack/src",
24
- "glob": "**/*.d.ts",
25
- "output": "./src"
26
- },
27
- {
28
- "input": "./packages/rspack",
29
- "glob": "**.json",
30
- "output": ".",
31
- "ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"]
32
- },
33
- "LICENSE"
34
- ]
35
- }
36
- }
37
- },
38
- "tags": []
39
- }
@@ -1,268 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`convert-to-inferred all projects should migrate all projects using the rspack executors 1`] = `
4
- "const { NxAppRspackPlugin } = require('@nx/rspack/app-plugin');
5
- const { NxReactRspackPlugin } = require('@nx/rspack/react-plugin');
6
- const { useLegacyNxPlugin } = require('@nx/rspack');
7
-
8
- // These options were migrated by @nx/rspack:convert-to-inferred from
9
- // the project.json file and merged with the options in this file
10
- const configValues = {
11
- build: {
12
- default: {
13
- outputPath: '../../dist/apps/app1',
14
- index: './src/index.html',
15
- main: './src/main.tsx',
16
- tsConfig: './tsconfig.app.json',
17
- assets: ['./src/favicon.ico', './src/assets'],
18
- styles: ['./src/styles.scss'],
19
- },
20
- development: {
21
- extractLicenses: false,
22
- optimization: false,
23
- sourceMap: true,
24
- vendorChunk: true,
25
- },
26
- production: {
27
- fileReplacements: [
28
- {
29
- replace: './src/environments/environment.ts',
30
- with: './src/environments/environment.prod.ts',
31
- },
32
- ],
33
- optimization: true,
34
- outputHashing: 'all',
35
- sourceMap: false,
36
- namedChunks: false,
37
- extractLicenses: true,
38
- vendorChunk: false,
39
- },
40
- },
41
- serve: {
42
- default: {
43
- hmr: true,
44
- server: {
45
- type: 'https',
46
- options: { cert: './server.crt', key: './server.key' },
47
- },
48
- port: 4200,
49
- headers: { 'Access-Control-Allow-Origin': '*' },
50
- historyApiFallback: {
51
- index: '/index.html',
52
- disableDotRule: true,
53
- htmlAcceptHeaders: ['text/html', 'application/xhtml+xml'],
54
- },
55
- },
56
- development: { open: true },
57
- production: { hmr: false },
58
- },
59
- };
60
-
61
- // Determine the correct configValue to use based on the configuration
62
- const configuration = process.env.NX_TASK_TARGET_CONFIGURATION || 'default';
63
-
64
- const buildOptions = {
65
- ...configValues.build.default,
66
- ...configValues.build[configuration],
67
- };
68
- const devServerOptions = {
69
- ...configValues.serve.default,
70
- ...configValues.serve[configuration],
71
- };
72
-
73
- /**
74
- * @type{import('@rspack/core').RspackOptionsNormalized}
75
- */
76
- module.exports = async () => ({
77
- devServer: devServerOptions,
78
- plugins: [
79
- new NxAppRspackPlugin(buildOptions),
80
- new NxReactRspackPlugin({
81
- // Uncomment this line if you don't want to use SVGR
82
- // See: https://react-svgr.com/
83
- // svgr: false
84
- }),
85
- // eslint-disable-next-line react-hooks/rules-of-hooks
86
- await useLegacyNxPlugin(require('./rspack.config.old'), buildOptions),
87
- ],
88
- });
89
- "
90
- `;
91
-
92
- exports[`convert-to-inferred all projects should migrate all projects using the rspack executors 2`] = `
93
- "const { NxAppRspackPlugin } = require('@nx/rspack/app-plugin');
94
- const { NxReactRspackPlugin } = require('@nx/rspack/react-plugin');
95
- const { useLegacyNxPlugin } = require('@nx/rspack');
96
-
97
- // These options were migrated by @nx/rspack:convert-to-inferred from
98
- // the project.json file and merged with the options in this file
99
- const configValues = {
100
- build: {
101
- default: {
102
- outputPath: '../../dist/apps/app2',
103
- index: './src/index.html',
104
- main: './src/main.tsx',
105
- tsConfig: './tsconfig.app.json',
106
- assets: ['./src/favicon.ico', './src/assets'],
107
- styles: ['./src/styles.scss'],
108
- },
109
- development: {
110
- extractLicenses: false,
111
- optimization: false,
112
- sourceMap: true,
113
- vendorChunk: true,
114
- },
115
- production: {
116
- fileReplacements: [
117
- {
118
- replace: './src/environments/environment.ts',
119
- with: './src/environments/environment.prod.ts',
120
- },
121
- ],
122
- optimization: true,
123
- outputHashing: 'all',
124
- sourceMap: false,
125
- namedChunks: false,
126
- extractLicenses: true,
127
- vendorChunk: false,
128
- },
129
- },
130
- serve: {
131
- default: {
132
- hmr: true,
133
- server: {
134
- type: 'https',
135
- options: { cert: './server.crt', key: './server.key' },
136
- },
137
- port: 4200,
138
- headers: { 'Access-Control-Allow-Origin': '*' },
139
- historyApiFallback: {
140
- index: '/index.html',
141
- disableDotRule: true,
142
- htmlAcceptHeaders: ['text/html', 'application/xhtml+xml'],
143
- },
144
- },
145
- development: { open: true },
146
- production: { hmr: false },
147
- },
148
- };
149
-
150
- // Determine the correct configValue to use based on the configuration
151
- const configuration = process.env.NX_TASK_TARGET_CONFIGURATION || 'default';
152
-
153
- const buildOptions = {
154
- ...configValues.build.default,
155
- ...configValues.build[configuration],
156
- };
157
- const devServerOptions = {
158
- ...configValues.serve.default,
159
- ...configValues.serve[configuration],
160
- };
161
-
162
- /**
163
- * @type{import('@rspack/core').RspackOptionsNormalized}
164
- */
165
- module.exports = async () => ({
166
- devServer: devServerOptions,
167
- plugins: [
168
- new NxAppRspackPlugin(buildOptions),
169
- new NxReactRspackPlugin({
170
- // Uncomment this line if you don't want to use SVGR
171
- // See: https://react-svgr.com/
172
- // svgr: false
173
- }),
174
- // eslint-disable-next-line react-hooks/rules-of-hooks
175
- await useLegacyNxPlugin(require('./rspack.config.old'), buildOptions),
176
- ],
177
- });
178
- "
179
- `;
180
-
181
- exports[`convert-to-inferred all projects should migrate all projects using the rspack executors 3`] = `
182
- "const { NxAppRspackPlugin } = require('@nx/rspack/app-plugin');
183
- const { NxReactRspackPlugin } = require('@nx/rspack/react-plugin');
184
- const { useLegacyNxPlugin } = require('@nx/rspack');
185
-
186
- // These options were migrated by @nx/rspack:convert-to-inferred from
187
- // the project.json file and merged with the options in this file
188
- const configValues = {
189
- build: {
190
- default: {
191
- outputPath: '../../dist/apps/app3',
192
- index: './src/index.html',
193
- main: './src/main.tsx',
194
- tsConfig: './tsconfig.app.json',
195
- assets: ['./src/favicon.ico', './src/assets'],
196
- styles: ['./src/styles.scss'],
197
- },
198
- development: {
199
- extractLicenses: false,
200
- optimization: false,
201
- sourceMap: true,
202
- vendorChunk: true,
203
- },
204
- production: {
205
- fileReplacements: [
206
- {
207
- replace: './src/environments/environment.ts',
208
- with: './src/environments/environment.prod.ts',
209
- },
210
- ],
211
- optimization: true,
212
- outputHashing: 'all',
213
- sourceMap: false,
214
- namedChunks: false,
215
- extractLicenses: true,
216
- vendorChunk: false,
217
- },
218
- },
219
- serve: {
220
- default: {
221
- hmr: true,
222
- server: {
223
- type: 'https',
224
- options: { cert: './server.crt', key: './server.key' },
225
- },
226
- port: 4200,
227
- headers: { 'Access-Control-Allow-Origin': '*' },
228
- historyApiFallback: {
229
- index: '/index.html',
230
- disableDotRule: true,
231
- htmlAcceptHeaders: ['text/html', 'application/xhtml+xml'],
232
- },
233
- },
234
- development: { open: true },
235
- production: { hmr: false },
236
- },
237
- };
238
-
239
- // Determine the correct configValue to use based on the configuration
240
- const configuration = process.env.NX_TASK_TARGET_CONFIGURATION || 'default';
241
-
242
- const buildOptions = {
243
- ...configValues.build.default,
244
- ...configValues.build[configuration],
245
- };
246
- const devServerOptions = {
247
- ...configValues.serve.default,
248
- ...configValues.serve[configuration],
249
- };
250
-
251
- /**
252
- * @type{import('@rspack/core').RspackOptionsNormalized}
253
- */
254
- module.exports = async () => ({
255
- devServer: devServerOptions,
256
- plugins: [
257
- new NxAppRspackPlugin(buildOptions),
258
- new NxReactRspackPlugin({
259
- // Uncomment this line if you don't want to use SVGR
260
- // See: https://react-svgr.com/
261
- // svgr: false
262
- }),
263
- // eslint-disable-next-line react-hooks/rules-of-hooks
264
- await useLegacyNxPlugin(require('./rspack.config.old'), buildOptions),
265
- ],
266
- });
267
- "
268
- `;