@rspack-canary/core 1.6.7-canary-e27a87e9-20251209100543 → 1.6.7-canary-f7e6adf4-20251211131042

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.
@@ -8,6 +8,7 @@ export interface ModuleFederationPluginOptions extends Omit<ModuleFederationPlug
8
8
  shareStrategy?: "version-first" | "loaded-first";
9
9
  injectUsedExports?: boolean;
10
10
  independentShareDir?: string;
11
+ treeshakeSharedExcludedPlugins?: string[];
11
12
  manifest?: ModuleFederationManifestPluginOptions;
12
13
  }
13
14
  export type RuntimePlugins = string[] | [string, Record<string, unknown>][];
package/dist/index.js CHANGED
@@ -5785,7 +5785,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
5785
5785
  }, applyExperimentsDefaults = (experiments, { development })=>{
5786
5786
  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, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1), D(experiments, "lazyBarrel", !0);
5787
5787
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
5788
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.7-canary-e27a87e9-20251209100543"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5788
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.6.7-canary-f7e6adf4-20251211131042"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
5789
5789
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, usedExports, inlineConst, deferImport })=>{
5790
5790
  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, { usedExports, inlineConst, deferImport })=>{
5791
5791
  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", [
@@ -7545,7 +7545,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7545
7545
  });
7546
7546
  }
7547
7547
  }
7548
- let CORE_VERSION = "1.6.7-canary-e27a87e9-20251209100543", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7548
+ let CORE_VERSION = "1.6.7-canary-f7e6adf4-20251211131042", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
7549
7549
 
7550
7550
  Help:
7551
7551
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -8854,7 +8854,7 @@ Help:
8854
8854
  obj.children = this.stats.map((stat, idx)=>{
8855
8855
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8856
8856
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8857
- }), childOptions.version && (obj.rspackVersion = "1.6.7-canary-e27a87e9-20251209100543", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8857
+ }), childOptions.version && (obj.rspackVersion = "1.6.7-canary-f7e6adf4-20251211131042", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8858
8858
  let mapError = (j, obj)=>({
8859
8859
  ...obj,
8860
8860
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -9753,7 +9753,7 @@ Help:
9753
9753
  object.hash = context.getStatsCompilation(compilation).hash;
9754
9754
  },
9755
9755
  version: (object)=>{
9756
- object.version = "5.75.0", object.rspackVersion = "1.6.7-canary-e27a87e9-20251209100543";
9756
+ object.version = "5.75.0", object.rspackVersion = "1.6.7-canary-f7e6adf4-20251211131042";
9757
9757
  },
9758
9758
  env: (object, _compilation, _context, { _env })=>{
9759
9759
  object.env = _env;
@@ -12079,10 +12079,11 @@ Help:
12079
12079
  manifest;
12080
12080
  buildAssets = {};
12081
12081
  injectUsedExports;
12082
+ treeshakeSharedExcludedPlugins;
12082
12083
  name = "IndependentSharedPlugin";
12083
12084
  constructor(options){
12084
- const { outputDir, plugins, treeshake, shared, name, manifest, injectUsedExports, library } = options;
12085
- this.shared = shared, this.mfName = name, this.outputDir = outputDir || "independent-packages", this.plugins = plugins || [], this.treeshake = treeshake, this.manifest = manifest, this.injectUsedExports = injectUsedExports ?? !0, this.library = library, this.sharedOptions = parseOptions(shared, (item, key)=>{
12085
+ const { outputDir, plugins, treeshake, shared, name, manifest, injectUsedExports, library, treeshakeSharedExcludedPlugins } = options;
12086
+ this.shared = shared, this.mfName = name, this.outputDir = outputDir || "independent-packages", this.plugins = plugins || [], this.treeshake = treeshake, this.manifest = manifest, this.injectUsedExports = injectUsedExports ?? !0, this.library = library, this.treeshakeSharedExcludedPlugins = treeshakeSharedExcludedPlugins || [], this.sharedOptions = parseOptions(shared, (item, key)=>{
12086
12087
  if ("string" != typeof item) throw Error(`Unexpected array in shared configuration for key "${key}"`);
12087
12088
  return item !== key && isRequiredVersion(item) ? {
12088
12089
  import: key,
@@ -12146,7 +12147,7 @@ Help:
12146
12147
  })), console.log("✅ All independent packages have been compiled successfully");
12147
12148
  }
12148
12149
  async createIndependentCompiler(parentCompiler, extraOptions) {
12149
- let extraPlugin, { mfName, plugins, outputDir, sharedOptions, treeshake, library } = this, outputDirWithShareName = resolveOutputDir(outputDir, extraOptions?.currentShare?.shareName || ""), parentConfig = parentCompiler.options, finalPlugins = [], rspack = parentCompiler.rspack;
12150
+ let extraPlugin, { mfName, plugins, outputDir, sharedOptions, treeshake, library, treeshakeSharedExcludedPlugins } = this, outputDirWithShareName = resolveOutputDir(outputDir, extraOptions?.currentShare?.shareName || ""), parentConfig = parentCompiler.options, finalPlugins = [], rspack = parentCompiler.rspack;
12150
12151
  extraPlugin = extraOptions ? new SharedContainerPlugin({
12151
12152
  mfName,
12152
12153
  library,
@@ -12155,7 +12156,7 @@ Help:
12155
12156
  sharedOptions,
12156
12157
  shareScope: "default"
12157
12158
  }), (parentConfig.plugins || []).forEach((plugin)=>{
12158
- void 0 !== plugin && "string" != typeof plugin && ((plugin)=>{
12159
+ void 0 !== plugin && "string" != typeof plugin && ((plugin, excludedPlugins = [])=>{
12159
12160
  if (!plugin) return !0;
12160
12161
  let pluginName = plugin.name || plugin.constructor?.name;
12161
12162
  return !pluginName || ![
@@ -12163,9 +12164,10 @@ Help:
12163
12164
  "IndependentSharedPlugin",
12164
12165
  "ModuleFederationPlugin",
12165
12166
  "SharedUsedExportsOptimizerPlugin",
12166
- "HtmlWebpackPlugin"
12167
+ "HtmlWebpackPlugin",
12168
+ ...excludedPlugins
12167
12169
  ].includes(pluginName);
12168
- })(plugin) && finalPlugins.push(plugin);
12170
+ })(plugin, treeshakeSharedExcludedPlugins) && finalPlugins.push(plugin);
12169
12171
  }), plugins.forEach((plugin)=>{
12170
12172
  finalPlugins.push(plugin);
12171
12173
  }), finalPlugins.push(extraPlugin), finalPlugins.push(new ConsumeSharedPlugin({
@@ -12238,7 +12240,8 @@ Help:
12238
12240
  plugins,
12239
12241
  treeshake: reshake,
12240
12242
  library,
12241
- manifest: mfConfig.manifest
12243
+ manifest: mfConfig.manifest,
12244
+ treeshakeSharedExcludedPlugins: mfConfig.treeshakeSharedExcludedPlugins
12242
12245
  }), this._independentSharePlugin.apply(compiler));
12243
12246
  }
12244
12247
  get buildAssets() {
@@ -12392,7 +12395,7 @@ Help:
12392
12395
  let _options = JSON.stringify(options || {});
12393
12396
  return binding_default().transform(source, _options);
12394
12397
  }
12395
- let exports_rspackVersion = "1.6.7-canary-e27a87e9-20251209100543", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
12398
+ let exports_rspackVersion = "1.6.7-canary-f7e6adf4-20251211131042", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
12396
12399
  getNormalizedRspackOptions: getNormalizedRspackOptions,
12397
12400
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
12398
12401
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -12,6 +12,7 @@ export interface IndependentSharePluginOptions {
12
12
  treeshake?: boolean;
13
13
  manifest?: ModuleFederationManifestPluginOptions;
14
14
  injectUsedExports?: boolean;
15
+ treeshakeSharedExcludedPlugins?: string[];
15
16
  }
16
17
  export type ShareFallback = Record<string, [string, string, string][]>;
17
18
  export declare class IndependentSharedPlugin {
@@ -25,6 +26,7 @@ export declare class IndependentSharedPlugin {
25
26
  manifest?: ModuleFederationManifestPluginOptions;
26
27
  buildAssets: ShareFallback;
27
28
  injectUsedExports?: boolean;
29
+ treeshakeSharedExcludedPlugins?: string[];
28
30
  name: string;
29
31
  constructor(options: IndependentSharePluginOptions);
30
32
  apply(compiler: Compiler): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-canary/core",
3
- "version": "1.6.7-canary-e27a87e9-20251209100543",
3
+ "version": "1.6.7-canary-f7e6adf4-20251211131042",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -58,7 +58,7 @@
58
58
  "dependencies": {
59
59
  "@module-federation/runtime-tools": "0.0.0-feat-shared-treeshake-poc-20251208061713",
60
60
  "@rspack/lite-tapable": "1.1.0",
61
- "@rspack/binding": "npm:@rspack-canary/binding@1.6.7-canary-e27a87e9-20251209100543"
61
+ "@rspack/binding": "npm:@rspack-canary/binding@1.6.7-canary-f7e6adf4-20251211131042"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@swc/helpers": ">=0.5.1"