@rspack/core 1.7.1 → 1.7.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.
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation, JsRuntimeModule } from '@rspack/binding';
10
+ import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from '@rspack/binding';
11
11
  import binding from '@rspack/binding';
12
12
  export type { AssetInfo } from '@rspack/binding';
13
13
  import * as liteTapable from '@rspack/lite-tapable';
@@ -185,7 +185,7 @@ export declare class Compilation {
185
185
  Set<string>
186
186
  ]>;
187
187
  runtimeRequirementInTree: liteTapable.HookMap<liteTapable.SyncBailHook<[Chunk, Set<string>], void>>;
188
- runtimeModule: liteTapable.SyncHook<[JsRuntimeModule, Chunk]>;
188
+ runtimeModule: liteTapable.SyncHook<[RuntimeModule, Chunk]>;
189
189
  seal: liteTapable.SyncHook<[]>;
190
190
  afterSeal: liteTapable.AsyncSeriesHook<[], void>;
191
191
  needAdditionalPass: liteTapable.SyncBailHook<[], boolean>;
@@ -1,4 +1,4 @@
1
- import type { JsAddingRuntimeModule } from '@rspack/binding';
1
+ import type { JsAddingRuntimeModule, JsRuntimeModule, JsSource } from '@rspack/binding';
2
2
  import type { Chunk } from './Chunk';
3
3
  import type { ChunkGraph } from './ChunkGraph';
4
4
  import type { Compilation } from './Compilation';
@@ -23,6 +23,7 @@ export declare class RuntimeModule {
23
23
  protected chunkGraph: ChunkGraph | null;
24
24
  constructor(name: string, stage?: RuntimeModuleStage);
25
25
  attach(compilation: Compilation, chunk: Chunk, chunkGraph: ChunkGraph): void;
26
+ get source(): JsSource | undefined;
26
27
  get name(): string;
27
28
  get stage(): RuntimeModuleStage;
28
29
  identifier(): string;
@@ -30,3 +31,4 @@ export declare class RuntimeModule {
30
31
  shouldIsolate(): boolean;
31
32
  generate(): string;
32
33
  }
34
+ export declare function createRenderedRuntimeModule(module: JsRuntimeModule): RuntimeModule;
@@ -38,6 +38,8 @@ export type ApiTargetProperties = {
38
38
  importScripts: boolean | null;
39
39
  /** has importScripts available when creating a worker */
40
40
  importScriptsInWorker: boolean | null;
41
+ /** node.js allows to use `import.meta.dirname` and `import.meta.filename` */
42
+ importMetaDirnameAndFilename: boolean | null;
41
43
  /** has fetch function available for WebAssembly */
42
44
  fetchWasm: boolean | null;
43
45
  /** has global variable available */
@@ -272,6 +272,8 @@ export type Environment = {
272
272
  dynamicImport?: boolean;
273
273
  /** The environment supports an async import() when creating a worker, only for web targets at the moment. */
274
274
  dynamicImportInWorker?: boolean;
275
+ /** The environment supports `import.meta.dirname` and `import.meta.filename`. */
276
+ importMetaDirnameAndFilename?: boolean;
275
277
  /** The environment supports 'for of' iteration ('for (const x of array) { ... }'). */
276
278
  forOf?: boolean;
277
279
  /** The environment supports 'globalThis'. */
@@ -851,6 +853,11 @@ export type JavascriptParserOptions = {
851
853
  worker?: string[] | boolean;
852
854
  /** Override the module to strict or non-strict. */
853
855
  overrideStrict?: 'strict' | 'non-strict';
856
+ /**
857
+ * Control whether renaming of the CommonJS `require` function will be parsed and transformed.
858
+ * @default true
859
+ */
860
+ requireAlias?: boolean;
854
861
  requireAsExpression?: boolean;
855
862
  requireDynamic?: boolean;
856
863
  requireResolve?: boolean;
package/dist/index.js CHANGED
@@ -667,6 +667,7 @@ for(var __rspack_i in (()=>{
667
667
  attach(compilation, chunk, chunkGraph) {
668
668
  this.compilation = compilation, this.chunk = chunk, this.chunkGraph = chunkGraph;
669
669
  }
670
+ get source() {}
670
671
  get name() {
671
672
  return this._name;
672
673
  }
@@ -3992,6 +3993,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
3992
3993
  ] : [] : parser.worker,
3993
3994
  overrideStrict: parser.overrideStrict,
3994
3995
  requireAsExpression: parser.requireAsExpression,
3996
+ requireAlias: parser.requireAlias,
3995
3997
  requireDynamic: parser.requireDynamic,
3996
3998
  requireResolve: parser.requireResolve,
3997
3999
  commonjs: parser.commonjs,
@@ -4121,7 +4123,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4121
4123
  if ('string' == typeof item || item instanceof RegExp) return item;
4122
4124
  if ('function' == typeof item) {
4123
4125
  let processResolveResult = this.#processResolveResult;
4124
- return async (ctx)=>await new Promise((resolve, reject)=>{
4126
+ return async (ctx)=>new Promise((resolve, reject)=>{
4125
4127
  let data = ctx.data(), promise = item({
4126
4128
  request: data.request,
4127
4129
  dependencyType: data.dependencyType,
@@ -4805,10 +4807,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4805
4807
  'async-node'
4806
4808
  ].includes(compiler.options.output.chunkLoading)) return;
4807
4809
  let hwpHooks = getHooks(compilation);
4808
- hwpHooks.beforeAssetTagGeneration.tapPromise(SubresourceIntegrityPlugin_PLUGIN_NAME, async (data)=>(self.handleHwpPluginArgs(data), data)), hwpHooks.alterAssetTagGroups.tapPromise({
4810
+ hwpHooks.beforeAssetTagGeneration.tapPromise(SubresourceIntegrityPlugin_PLUGIN_NAME, (data)=>(self.handleHwpPluginArgs(data), Promise.resolve(data))), hwpHooks.alterAssetTagGroups.tapPromise({
4809
4811
  name: SubresourceIntegrityPlugin_PLUGIN_NAME,
4810
4812
  stage: 10000
4811
- }, async (data)=>(self.handleHwpBodyTags(data, compiler.outputPath, compiler.options.output.crossOriginLoading), data));
4813
+ }, (data)=>(self.handleHwpBodyTags(data, compiler.outputPath, compiler.options.output.crossOriginLoading), Promise.resolve(data)));
4812
4814
  });
4813
4815
  } catch (e) {
4814
4816
  if (!((obj = e) instanceof Error && 'code' in obj && [
@@ -5554,6 +5556,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5554
5556
  18
5555
5557
  ]
5556
5558
  }),
5559
+ importMetaDirnameAndFilename: nodeProperty && rawChecker({
5560
+ node: [
5561
+ 22,
5562
+ 16
5563
+ ]
5564
+ }),
5557
5565
  require: nodeProperty
5558
5566
  };
5559
5567
  }, getBrowserslistTargetHandler = memoize(()=>browserslistTargetHandler_namespaceObject), hasBrowserslistConfig = (context)=>{
@@ -5634,6 +5642,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5634
5642
  require: !asyncFlag,
5635
5643
  nodeBuiltins: !0,
5636
5644
  nodePrefixForCoreModules: 15 > +major ? v(14, 18) : v(16),
5645
+ importMetaDirnameAndFilename: v(22, 16),
5637
5646
  global: !0,
5638
5647
  document: !1,
5639
5648
  fetchWasm: !1,
@@ -5674,6 +5683,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5674
5683
  global: !0,
5675
5684
  nodeBuiltins: !0,
5676
5685
  nodePrefixForCoreModules: v(15),
5686
+ importMetaDirnameAndFilename: v(37),
5677
5687
  require: !0,
5678
5688
  document: 'renderer' === context,
5679
5689
  fetchWasm: 'renderer' === context,
@@ -5844,12 +5854,12 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5844
5854
  }, applyExperimentsDefaults = (experiments, { development })=>{
5845
5855
  F(experiments, 'cache', ()=>development), D(experiments, 'futureDefaults', !1), D(experiments, 'lazyCompilation', !1), D(experiments, 'asyncWebAssembly', experiments.futureDefaults), D(experiments, 'css', !!experiments.futureDefaults || void 0), D(experiments, 'topLevelAwait', !0), D(experiments, 'deferImport', !1), D(experiments, 'buildHttp', void 0), experiments.buildHttp && 'object' == typeof experiments.buildHttp && D(experiments.buildHttp, 'upgrade', !1), D(experiments, 'incremental', {}), 'object' == typeof experiments.incremental && (D(experiments.incremental, 'silent', !0), D(experiments.incremental, 'make', !0), D(experiments.incremental, 'inferAsyncModules', !0), D(experiments.incremental, 'providedExports', !0), D(experiments.incremental, 'dependenciesDiagnostics', !0), D(experiments.incremental, 'sideEffects', !0), D(experiments.incremental, 'buildChunkGraph', !1), D(experiments.incremental, 'moduleIds', !0), D(experiments.incremental, 'chunkIds', !0), D(experiments.incremental, 'modulesHashes', !0), D(experiments.incremental, 'modulesCodegen', !0), D(experiments.incremental, 'modulesRuntimeRequirements', !0), D(experiments.incremental, 'chunksRuntimeRequirements', !0), D(experiments.incremental, 'chunksHashes', !0), D(experiments.incremental, 'chunksRender', !0), D(experiments.incremental, 'emitAssets', !0)), D(experiments, 'rspackFuture', {}), D(experiments, 'parallelLoader', !1), D(experiments, 'useInputFileSystem', !1), D(experiments, 'inlineConst', !0), D(experiments, 'inlineEnum', !1), D(experiments, 'typeReexportsPresence', !1), D(experiments, 'lazyBarrel', !0);
5846
5856
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
5847
- 'object' == typeof rspackFuture && (D(rspackFuture, 'bundlerInfo', {}), 'object' == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, 'version', "1.7.1"), D(rspackFuture.bundlerInfo, 'bundler', 'rspack'), D(rspackFuture.bundlerInfo, 'force', !library)));
5857
+ 'object' == typeof rspackFuture && (D(rspackFuture, 'bundlerInfo', {}), 'object' == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, 'version', "1.7.2"), D(rspackFuture.bundlerInfo, 'bundler', 'rspack'), D(rspackFuture.bundlerInfo, 'force', !library)));
5848
5858
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyCssGeneratorOptionsDefaults = (generatorOptions, { targetProperties })=>{
5849
5859
  D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0);
5850
5860
  }, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, deferImport })=>{
5851
5861
  if (assertNotNill(module1.parser), assertNotNill(module1.generator), cache ? D(module1, 'unsafeCache', /[\\/]node_modules[\\/]/) : D(module1, 'unsafeCache', !1), F(module1.parser, "asset", ()=>({})), assertNotNill(module1.parser.asset), F(module1.parser.asset, 'dataUrlCondition', ()=>({})), 'object' == typeof module1.parser.asset.dataUrlCondition && D(module1.parser.asset.dataUrlCondition, 'maxSize', 8096), F(module1.parser, "javascript", ()=>({})), assertNotNill(module1.parser.javascript), ((parserOptions, { deferImport })=>{
5852
- D(parserOptions, 'dynamicImportMode', 'lazy'), D(parserOptions, 'dynamicImportPrefetch', !1), D(parserOptions, 'dynamicImportPreload', !1), D(parserOptions, 'url', !0), D(parserOptions, 'exprContextCritical', !0), D(parserOptions, 'unknownContextCritical', !0), D(parserOptions, 'wrappedContextCritical', !1), D(parserOptions, 'wrappedContextRegExp', /.*/), D(parserOptions, 'strictExportPresence', !1), D(parserOptions, 'requireAsExpression', !0), D(parserOptions, 'requireDynamic', !0), D(parserOptions, 'requireResolve', !0), D(parserOptions, 'commonjs', !0), D(parserOptions, 'importDynamic', !0), D(parserOptions, 'worker', [
5862
+ D(parserOptions, 'dynamicImportMode', 'lazy'), D(parserOptions, 'dynamicImportPrefetch', !1), D(parserOptions, 'dynamicImportPreload', !1), D(parserOptions, 'url', !0), D(parserOptions, 'exprContextCritical', !0), D(parserOptions, 'unknownContextCritical', !0), D(parserOptions, 'wrappedContextCritical', !1), D(parserOptions, 'wrappedContextRegExp', /.*/), D(parserOptions, 'strictExportPresence', !1), D(parserOptions, 'requireAsExpression', !0), D(parserOptions, 'requireAlias', !0), D(parserOptions, 'requireDynamic', !0), D(parserOptions, 'requireResolve', !0), D(parserOptions, 'commonjs', !0), D(parserOptions, 'importDynamic', !0), D(parserOptions, 'worker', [
5853
5863
  '...'
5854
5864
  ]), D(parserOptions, 'importMeta', !0), D(parserOptions, 'typeReexportsPresence', 'no-tolerant'), D(parserOptions, 'jsx', !1), D(parserOptions, 'deferImport', deferImport);
5855
5865
  })(module1.parser.javascript, {
@@ -6038,7 +6048,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6038
6048
  }), F(environment, 'nodePrefixForCoreModules', ()=>{
6039
6049
  let v;
6040
6050
  return tp && ((v = tp.nodePrefixForCoreModules) || void 0 === v);
6041
- }), F(environment, 'templateLiteral', ()=>{
6051
+ }), F(environment, 'importMetaDirnameAndFilename', ()=>tp?.importMetaDirnameAndFilename), F(environment, 'templateLiteral', ()=>{
6042
6052
  let v;
6043
6053
  return tp && ((v = tp.templateLiteral) || void 0 === v);
6044
6054
  }), F(environment, 'dynamicImport', ()=>conditionallyOptimistic(tp?.dynamicImport, output.module)), F(environment, 'dynamicImportInWorker', ()=>conditionallyOptimistic(tp?.dynamicImportInWorker, output.module)), F(environment, 'module', ()=>conditionallyOptimistic(tp?.module, output.module)), F(environment, 'document', ()=>{
@@ -7003,24 +7013,22 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7003
7013
  if (super(fs), !fs) return;
7004
7014
  this.open = memoizeFn(()=>external_node_util_default().promisify(fs.open.bind(fs))), this.rename = memoizeFn(()=>external_node_util_default().promisify(fs.rename.bind(fs))), this.close = memoizeFn(()=>external_node_util_default().promisify(fs.close.bind(fs))), this.write = memoizeFn(()=>{
7005
7015
  let writeFn = external_node_util_default().promisify(fs.write.bind(fs));
7006
- return async (fd, content, position)=>await writeFn(fd, content, {
7016
+ return async (fd, content, position)=>writeFn(fd, content, {
7007
7017
  position
7008
7018
  });
7009
7019
  }), this.writeAll = memoizeFn(()=>{
7010
7020
  let writeFn = external_node_util_default().promisify(fs.writeFile.bind(fs));
7011
- return async (fd, content)=>await writeFn(fd, content);
7021
+ return async (fd, content)=>writeFn(fd, content);
7012
7022
  }), this.read = memoizeFn(()=>{
7013
7023
  let readFn = fs.read.bind(fs);
7014
- return async (fd, length, position)=>{
7015
- new Promise((resolve)=>{
7024
+ return (fd, length, position)=>new Promise((resolve, reject)=>{
7016
7025
  readFn(fd, {
7017
7026
  position,
7018
7027
  length
7019
7028
  }, (err, _bytesRead, buffer)=>{
7020
- err ? resolve(err) : resolve(buffer);
7029
+ err ? reject(err) : resolve(buffer);
7021
7030
  });
7022
7031
  });
7023
- };
7024
7032
  }), this.readUntil = memoizeFn(()=>async (fd, delim, position)=>{
7025
7033
  let res = [], current_position = position;
7026
7034
  for(;;){
@@ -7414,7 +7422,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7414
7422
  obj.children = this.stats.map((stat, idx)=>{
7415
7423
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
7416
7424
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
7417
- }), childOptions.version && (obj.rspackVersion = "1.7.1", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
7425
+ }), childOptions.version && (obj.rspackVersion = "1.7.2", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
7418
7426
  let mapError = (j, obj)=>({
7419
7427
  ...obj,
7420
7428
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -8670,7 +8678,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
8670
8678
  object.hash = context.getStatsCompilation(compilation).hash;
8671
8679
  },
8672
8680
  version: (object)=>{
8673
- object.version = "5.75.0", object.rspackVersion = "1.7.1";
8681
+ object.version = "5.75.0", object.rspackVersion = "1.7.2";
8674
8682
  },
8675
8683
  env: (object, _compilation, _context, { _env })=>{
8676
8684
  object.env = _env;
@@ -10395,7 +10403,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
10395
10403
  });
10396
10404
  }
10397
10405
  }
10398
- let CORE_VERSION = "1.7.1", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10406
+ let CORE_VERSION = "1.7.2", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10399
10407
 
10400
10408
  Help:
10401
10409
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -10943,11 +10951,13 @@ Help:
10943
10951
  destructuring: !!environment.destructuring,
10944
10952
  document: !!environment.document,
10945
10953
  dynamicImport: !!environment.dynamicImport,
10954
+ dynamicImportInWorker: !!environment.dynamicImportInWorker,
10946
10955
  forOf: !!environment.forOf,
10947
10956
  globalThis: !!environment.globalThis,
10948
10957
  module: !!environment.module,
10949
10958
  optionalChaining: !!environment.optionalChaining,
10950
- templateLiteral: !!environment.templateLiteral
10959
+ templateLiteral: !!environment.templateLiteral,
10960
+ importMetaDirnameAndFilename: !!environment.importMetaDirnameAndFilename
10951
10961
  };
10952
10962
  }(output.environment)
10953
10963
  },
@@ -11048,14 +11058,14 @@ Help:
11048
11058
  return getCompiler1().hooks.make;
11049
11059
  }, function(queried) {
11050
11060
  return async function() {
11051
- return await queried.promise(getCompiler1().__internal__get_compilation());
11061
+ return queried.promise(getCompiler1().__internal__get_compilation());
11052
11062
  };
11053
11063
  }),
11054
11064
  registerCompilerFinishMakeTaps: createTap1(binding_default().RegisterJsTapKind.CompilerFinishMake, function() {
11055
11065
  return getCompiler1().hooks.finishMake;
11056
11066
  }, function(queried) {
11057
11067
  return async function() {
11058
- return await queried.promise(getCompiler1().__internal__get_compilation());
11068
+ return queried.promise(getCompiler1().__internal__get_compilation());
11059
11069
  };
11060
11070
  }),
11061
11071
  registerCompilerShouldEmitTaps: createTap1(binding_default().RegisterJsTapKind.CompilerShouldEmit, function() {
@@ -11069,14 +11079,14 @@ Help:
11069
11079
  return getCompiler1().hooks.emit;
11070
11080
  }, function(queried) {
11071
11081
  return async function() {
11072
- return await queried.promise(getCompiler1().__internal__get_compilation());
11082
+ return queried.promise(getCompiler1().__internal__get_compilation());
11073
11083
  };
11074
11084
  }),
11075
11085
  registerCompilerAfterEmitTaps: createTap1(binding_default().RegisterJsTapKind.CompilerAfterEmit, function() {
11076
11086
  return getCompiler1().hooks.afterEmit;
11077
11087
  }, function(queried) {
11078
11088
  return async function() {
11079
- return await queried.promise(getCompiler1().__internal__get_compilation());
11089
+ return queried.promise(getCompiler1().__internal__get_compilation());
11080
11090
  };
11081
11091
  }),
11082
11092
  registerCompilerAssetEmittedTaps: createTap1(binding_default().RegisterJsTapKind.CompilerAssetEmitted, function() {
@@ -11129,8 +11139,39 @@ Help:
11129
11139
  return getCompiler2().__internal__get_compilation().hooks.runtimeModule;
11130
11140
  }, function(queried) {
11131
11141
  return function({ module: module1, chunk }) {
11142
+ var module2;
11143
+ let runtimeModule = new ({
11144
+ [(module2 = module1).constructorName]: class extends RuntimeModule {
11145
+ _source;
11146
+ constructor(){
11147
+ super(module2.name, module2.stage), this._source = module2.source;
11148
+ }
11149
+ get constructorName() {
11150
+ return module2.constructorName;
11151
+ }
11152
+ get moduleIdentifier() {
11153
+ return module2.moduleIdentifier;
11154
+ }
11155
+ get source() {
11156
+ return this._source;
11157
+ }
11158
+ identifier() {
11159
+ return module2.moduleIdentifier;
11160
+ }
11161
+ readableIdentifier() {
11162
+ return module2.moduleIdentifier;
11163
+ }
11164
+ shouldIsolate() {
11165
+ return module2.isolate;
11166
+ }
11167
+ generate() {
11168
+ return this._source?.source.toString('utf-8') || '';
11169
+ }
11170
+ }
11171
+ })[module2.constructorName](), compilation = getCompiler2().__internal__get_compilation();
11172
+ runtimeModule.attach(compilation, chunk, compilation.chunkGraph);
11132
11173
  let originSource = module1.source?.source;
11133
- queried.call(module1, chunk);
11174
+ queried.call(runtimeModule, chunk);
11134
11175
  let newSource = module1.source?.source;
11135
11176
  if (newSource && newSource !== originSource) return module1;
11136
11177
  };
@@ -11205,7 +11246,7 @@ Help:
11205
11246
  return getCompiler2().__internal__get_compilation().hooks.finishModules;
11206
11247
  }, function(queried) {
11207
11248
  return async function() {
11208
- return await queried.promise(getCompiler2().__internal__get_compilation().modules);
11249
+ return queried.promise(getCompiler2().__internal__get_compilation().modules);
11209
11250
  };
11210
11251
  }),
11211
11252
  registerCompilationOptimizeModulesTaps: createTap2(binding_default().RegisterJsTapKind.CompilationOptimizeModules, function() {
@@ -11226,14 +11267,14 @@ Help:
11226
11267
  return getCompiler2().__internal__get_compilation().hooks.optimizeTree;
11227
11268
  }, function(queried) {
11228
11269
  return async function() {
11229
- return await queried.promise(getCompiler2().__internal__get_compilation().chunks, getCompiler2().__internal__get_compilation().modules);
11270
+ return queried.promise(getCompiler2().__internal__get_compilation().chunks, getCompiler2().__internal__get_compilation().modules);
11230
11271
  };
11231
11272
  }),
11232
11273
  registerCompilationOptimizeChunkModulesTaps: createTap2(binding_default().RegisterJsTapKind.CompilationOptimizeChunkModules, function() {
11233
11274
  return getCompiler2().__internal__get_compilation().hooks.optimizeChunkModules;
11234
11275
  }, function(queried) {
11235
11276
  return async function() {
11236
- return await queried.promise(getCompiler2().__internal__get_compilation().chunks, getCompiler2().__internal__get_compilation().modules);
11277
+ return queried.promise(getCompiler2().__internal__get_compilation().chunks, getCompiler2().__internal__get_compilation().modules);
11237
11278
  };
11238
11279
  }),
11239
11280
  registerCompilationChunkHashTaps: createTap2(binding_default().RegisterJsTapKind.CompilationChunkHash, function() {
@@ -11257,7 +11298,7 @@ Help:
11257
11298
  return getCompiler2().__internal__get_compilation().hooks.processAssets;
11258
11299
  }, function(queried) {
11259
11300
  return async function() {
11260
- return await queried.promise(getCompiler2().__internal__get_compilation().assets);
11301
+ return queried.promise(getCompiler2().__internal__get_compilation().assets);
11261
11302
  };
11262
11303
  }),
11263
11304
  registerCompilationAfterProcessAssetsTaps: createTap2(binding_default().RegisterJsTapKind.CompilationAfterProcessAssets, function() {
@@ -11278,7 +11319,7 @@ Help:
11278
11319
  return getCompiler2().__internal__get_compilation().hooks.afterSeal;
11279
11320
  }, function(queried) {
11280
11321
  return async function() {
11281
- return await queried.promise();
11322
+ return queried.promise();
11282
11323
  };
11283
11324
  })
11284
11325
  }),
@@ -11487,35 +11528,35 @@ Help:
11487
11528
  return RsdoctorPluginImpl.getCompilationHooks(getCompiler7().__internal__get_compilation()).moduleGraph;
11488
11529
  }, function(queried) {
11489
11530
  return async function(data) {
11490
- return await queried.promise(data);
11531
+ return queried.promise(data);
11491
11532
  };
11492
11533
  }),
11493
11534
  registerRsdoctorPluginChunkGraphTaps: createTap6(binding_.RegisterJsTapKind.RsdoctorPluginChunkGraph, function() {
11494
11535
  return RsdoctorPluginImpl.getCompilationHooks(getCompiler7().__internal__get_compilation()).chunkGraph;
11495
11536
  }, function(queried) {
11496
11537
  return async function(data) {
11497
- return await queried.promise(data);
11538
+ return queried.promise(data);
11498
11539
  };
11499
11540
  }),
11500
11541
  registerRsdoctorPluginModuleIdsTaps: createTap6(binding_.RegisterJsTapKind.RsdoctorPluginModuleIds, function() {
11501
11542
  return RsdoctorPluginImpl.getCompilationHooks(getCompiler7().__internal__get_compilation()).moduleIds;
11502
11543
  }, function(queried) {
11503
11544
  return async function(data) {
11504
- return await queried.promise(data);
11545
+ return queried.promise(data);
11505
11546
  };
11506
11547
  }),
11507
11548
  registerRsdoctorPluginModuleSourcesTaps: createTap6(binding_.RegisterJsTapKind.RsdoctorPluginModuleSources, function() {
11508
11549
  return RsdoctorPluginImpl.getCompilationHooks(getCompiler7().__internal__get_compilation()).moduleSources;
11509
11550
  }, function(queried) {
11510
11551
  return async function(data) {
11511
- return await queried.promise(data);
11552
+ return queried.promise(data);
11512
11553
  };
11513
11554
  }),
11514
11555
  registerRsdoctorPluginAssetsTaps: createTap6(binding_.RegisterJsTapKind.RsdoctorPluginAssets, function() {
11515
11556
  return RsdoctorPluginImpl.getCompilationHooks(getCompiler7().__internal__get_compilation()).assets;
11516
11557
  }, function(queried) {
11517
11558
  return async function(data) {
11518
- return await queried.promise(data);
11559
+ return queried.promise(data);
11519
11560
  };
11520
11561
  })
11521
11562
  })
@@ -12156,7 +12197,7 @@ Help:
12156
12197
  let _options = JSON.stringify(options || {});
12157
12198
  return binding_default().transform(source, _options);
12158
12199
  }
12159
- let exports_rspackVersion = "1.7.1", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
12200
+ let exports_rspackVersion = "1.7.2", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
12160
12201
  getNormalizedRspackOptions: getNormalizedRspackOptions,
12161
12202
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
12162
12203
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -12356,7 +12397,7 @@ Help:
12356
12397
  await JavaScriptTracer.initJavaScriptTrace(layer, output), (0, binding_.registerGlobalTrace)(filter, layer, output), JavaScriptTracer.initCpuProfiler();
12357
12398
  },
12358
12399
  async cleanup () {
12359
- await JavaScriptTracer.cleanupJavaScriptTrace(), await (0, binding_.syncTraceEvent)(JavaScriptTracer.events), (0, binding_.cleanupGlobalTrace)();
12400
+ await JavaScriptTracer.cleanupJavaScriptTrace(), (0, binding_.syncTraceEvent)(JavaScriptTracer.events), (0, binding_.cleanupGlobalTrace)();
12360
12401
  }
12361
12402
  },
12362
12403
  RemoveDuplicateModulesPlugin: RemoveDuplicateModulesPlugin,
package/dist/worker.js CHANGED
@@ -956,12 +956,12 @@ for(var __rspack_i in (()=>{
956
956
  }), sendRequest1), waitFor = (sendRequest = sendRequest2, (requests)=>sendRequest.sync("WaitForPendingRequest", (Array.isArray(requests) ? requests : [
957
957
  requests
958
958
  ]).map((request)=>request.id)));
959
- loaderImpl(workerOptions, sendRequest2, waitFor).then(async (data)=>{
959
+ loaderImpl(workerOptions, sendRequest2, waitFor).then((data)=>{
960
960
  workerData.workerPort.postMessage({
961
961
  type: 'done',
962
962
  data
963
963
  });
964
- }).catch(async (err)=>{
964
+ }).catch((err)=>{
965
965
  workerData.workerPort.postMessage({
966
966
  type: 'done-error',
967
967
  error: serializeError(err)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -37,10 +37,10 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@ast-grep/napi": "^0.40.3",
40
+ "@ast-grep/napi": "^0.40.4",
41
41
  "@napi-rs/wasm-runtime": "1.0.7",
42
42
  "@rsbuild/plugin-node-polyfill": "^1.4.2",
43
- "@rslib/core": "0.19.0",
43
+ "@rslib/core": "0.19.1",
44
44
  "@swc/types": "0.1.25",
45
45
  "@types/node": "^20.19.27",
46
46
  "@types/watchpack": "^2.4.5",
@@ -58,7 +58,7 @@
58
58
  "dependencies": {
59
59
  "@module-federation/runtime-tools": "0.22.0",
60
60
  "@rspack/lite-tapable": "1.1.0",
61
- "@rspack/binding": "1.7.1"
61
+ "@rspack/binding": "1.7.2"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@swc/helpers": ">=0.5.1"