@rspack-debug/test-tools 2.0.0-alpha.1 → 2.0.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.
@@ -94,7 +94,7 @@ function overrideOptions(index, context, options) {
94
94
  if (!options.output?.filename) {
95
95
  const runtimeChunkForModernModule = options.optimization?.runtimeChunk === undefined &&
96
96
  enableEsmLibraryPlugin(options);
97
- const outputModule = options.experiments?.outputModule || enableEsmLibraryPlugin(options);
97
+ const outputModule = options.output?.module || enableEsmLibraryPlugin(options);
98
98
  options.output ??= {};
99
99
  options.output.filename = `${runtimeChunkForModernModule ? `[name]${outputModule ? '.mjs' : '.js'}` : `bundle${index}${outputModule ? '.mjs' : '.js'}`}`;
100
100
  }
@@ -97,9 +97,6 @@ const defaultOptions = (_index, context) => ({
97
97
  fs: 'module-import fs',
98
98
  path: 'module-import path',
99
99
  },
100
- experiments: {
101
- outputModule: true,
102
- },
103
100
  });
104
101
  function createEsmOutputCase(name, src, dist) {
105
102
  creator.create(name, src, dist);
@@ -144,6 +144,7 @@ function defaultOptions(context, compilerOptions, mode) {
144
144
  bundlerInfo: {
145
145
  force: false,
146
146
  },
147
+ ...(compilerOptions?.module ? { module: true } : {}),
147
148
  },
148
149
  resolve: {
149
150
  modules: ['web_modules', 'node_modules'],
@@ -196,13 +197,11 @@ function defaultOptions(context, compilerOptions, mode) {
196
197
  });
197
198
  }),
198
199
  experiments: {
199
- css: false,
200
200
  asyncWebAssembly: true,
201
201
  // CHANGE: rspack does not support `backCompat` yet.
202
202
  // backCompat: false,
203
203
  // CHANGE: Rspack enables `css` by default.
204
204
  // Turning off here to fallback to webpack's default css processing logic.
205
- ...(compilerOptions?.module ? { outputModule: true } : {}),
206
205
  },
207
206
  };
208
207
  }
@@ -9,8 +9,24 @@ module.exports = function copyDiff(src, dest, initial) {
9
9
  for (const filename of files) {
10
10
  const srcFile = path.join(src, filename);
11
11
  const destFile = path.join(dest, filename);
12
- const directory = fs.statSync(srcFile).isDirectory();
13
- if (directory) {
12
+ const stats = fs.lstatSync(srcFile);
13
+ if (stats.isSymbolicLink()) {
14
+ const linkTarget = fs.readlinkSync(srcFile);
15
+ if (fs.existsSync(destFile)) {
16
+ const destStats = fs.lstatSync(destFile);
17
+ if (destStats.isSymbolicLink()) {
18
+ fs.unlinkSync(destFile);
19
+ }
20
+ else if (destStats.isDirectory()) {
21
+ rimrafSync(destFile);
22
+ }
23
+ else {
24
+ fs.unlinkSync(destFile);
25
+ }
26
+ }
27
+ fs.symlinkSync(linkTarget, destFile);
28
+ }
29
+ else if (stats.isDirectory()) {
14
30
  copyDiff(srcFile, destFile, initial);
15
31
  }
16
32
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-debug/test-tools",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-beta.0",
4
4
  "license": "MIT",
5
5
  "description": "Test tools for rspack",
6
6
  "main": "dist/index.js",
@@ -65,7 +65,7 @@
65
65
  "@types/jsdom": "^21.1.7",
66
66
  "typescript": "^5.9.3",
67
67
  "wast-loader": "^1.14.1",
68
- "@rspack/core": "npm:@rspack-debug/core@2.0.0-alpha.1"
68
+ "@rspack/core": "npm:@rspack-debug/core@2.0.0-beta.0"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "@rspack/core": ">=1.0.0"