@rspack/core 1.4.8 → 1.4.9

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.
@@ -1,4 +1,4 @@
1
- import * as binding from "@rspack/binding";
1
+ import binding from "@rspack/binding";
2
2
  import type { Source } from "../compiled/webpack-sources";
3
3
  declare const $assets: unique symbol;
4
4
  declare module "@rspack/binding" {
package/dist/Chunk.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type ChunkGroup } from "@rspack/binding";
1
2
  interface ChunkMaps {
2
3
  hash: Record<string | number, string>;
3
4
  contentHash: Record<string | number, Record<string, string>>;
@@ -1,6 +1,6 @@
1
1
  import type { RuntimeSpec } from "./util/runtime";
2
2
  declare module "@rspack/binding" {
3
- interface Chunk {
3
+ interface ChunkGraph {
4
4
  getModuleChunksIterable(module: Module): Iterable<Chunk>;
5
5
  getOrderedChunkModulesIterable(chunk: Chunk, compareFn: (a: Module, b: Module) => number): Iterable<Module>;
6
6
  getModuleHash(module: Module, runtime: RuntimeSpec): string | null;
@@ -8,7 +8,7 @@
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
10
  import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation, JsRuntimeModule } from "@rspack/binding";
11
- import * as binding from "@rspack/binding";
11
+ import binding from "@rspack/binding";
12
12
  export type { AssetInfo } from "@rspack/binding";
13
13
  import * as liteTapable from "@rspack/lite-tapable";
14
14
  import type { Source } from "../compiled/webpack-sources";
@@ -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 * as binding from "@rspack/binding";
10
+ import type binding from "@rspack/binding";
11
11
  import * as liteTapable from "@rspack/lite-tapable";
12
12
  import type Watchpack from "../compiled/watchpack";
13
13
  import type { Source } from "../compiled/webpack-sources";
package/dist/Module.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as binding from "@rspack/binding";
1
+ import binding, { type AssetInfo } from "@rspack/binding";
2
2
  import type { Source } from "../compiled/webpack-sources";
3
3
  import type { ResourceData } from "./Resolver";
4
4
  import "./BuildInfo";
@@ -1,4 +1,4 @@
1
- import * as binding from "@rspack/binding";
1
+ import binding from "@rspack/binding";
2
2
  import type Watchpack from "../compiled/watchpack";
3
3
  import type { FileSystemInfoEntry, Watcher, WatchFileSystem } from "./util/fs";
4
4
  export default class NativeWatchFileSystem implements WatchFileSystem {
@@ -1,4 +1,4 @@
1
- import type * as binding from "@rspack/binding";
1
+ import type binding from "@rspack/binding";
2
2
  import * as liteTapable from "@rspack/lite-tapable";
3
3
  import type { ResolveData, ResourceDataWithData } from "./Module";
4
4
  import type { ResolverFactory } from "./ResolverFactory";
@@ -1,4 +1,4 @@
1
- import type * as binding from "@rspack/binding";
1
+ import type binding from "@rspack/binding";
2
2
  import { type Resolve } from "./config";
3
3
  import type { ResolveCallback } from "./config/adapterRuleUse";
4
4
  type ResolveContext = {};
@@ -7,10 +7,15 @@ type ResolveOptionsWithDependencyType = Resolve & {
7
7
  resolveToContext?: boolean;
8
8
  };
9
9
  export type ResourceData = binding.JsResourceData;
10
- export type ResolveRequest = ResourceData;
10
+ export interface ResolveRequest {
11
+ path: string;
12
+ query: string;
13
+ fragment: string;
14
+ descriptionFileData?: string;
15
+ descriptionFilePath?: string;
16
+ }
11
17
  export declare class Resolver {
12
18
  #private;
13
- binding: binding.JsResolver;
14
19
  constructor(binding: binding.JsResolver);
15
20
  resolveSync(context: object, path: string, request: string): string | false;
16
21
  resolve(context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void;
@@ -1,4 +1,4 @@
1
- import * as binding from "@rspack/binding";
1
+ import binding from "@rspack/binding";
2
2
  import { type Resolve } from "./config";
3
3
  import { Resolver } from "./Resolver";
4
4
  type ResolveOptionsWithDependencyType = Resolve & {
@@ -1,4 +1,4 @@
1
- import type * as binding from "@rspack/binding";
1
+ import type binding from "@rspack/binding";
2
2
  export type { RspackError } from "@rspack/binding";
3
3
  export type RspackSeverity = binding.JsRspackSeverity;
4
4
  export declare class NonErrorEmittedError extends Error {
@@ -1,4 +1,4 @@
1
- import * as binding from "@rspack/binding";
1
+ import binding from "@rspack/binding";
2
2
  export interface CssChunkingPluginOptions {
3
3
  strict?: boolean;
4
4
  minSize?: number;
@@ -1,4 +1,4 @@
1
- import * as binding from "@rspack/binding";
1
+ import binding from "@rspack/binding";
2
2
  import * as liteTapable from "@rspack/lite-tapable";
3
3
  import type { Chunk } from "../Chunk";
4
4
  import { type Compilation } from "../Compilation";
@@ -13,6 +13,7 @@ export type SwcJsMinimizerRspackPluginOptions = {
13
13
  extractComments?: ExtractCommentsOptions | undefined;
14
14
  minimizerOptions?: {
15
15
  minify?: boolean;
16
+ ecma?: TerserEcmaVersion;
16
17
  compress?: TerserCompressOptions | boolean;
17
18
  mangle?: TerserMangleOptions | boolean;
18
19
  format?: JsFormatOptions & ToSnakeCaseProperties<JsFormatOptions>;
@@ -1,4 +1,4 @@
1
- import * as binding from "@rspack/binding";
1
+ import binding from "@rspack/binding";
2
2
  import type { Compiler, RspackPluginInstance } from "..";
3
3
  type AffectedHooks = keyof Compiler["hooks"];
4
4
  export declare function canInherentFromParent(affectedHooks?: AffectedHooks): boolean;
@@ -320,7 +320,7 @@ export interface LoaderContext<OptionsType = {}> {
320
320
  *
321
321
  * @internal
322
322
  */
323
- __internal__parseMeta: Record<string, string>;
323
+ __internal__setParseMeta: (key: string, value: string) => void;
324
324
  }
325
325
  export type LoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> = (this: LoaderContext<OptionsType> & ContextAdditions, content: string, sourceMap?: string | SourceMap, additionalData?: AdditionalData) => string | void | Buffer | Promise<string | Buffer>;
326
326
  export type PitchLoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> = (this: LoaderContext<OptionsType> & ContextAdditions, remainingRequest: string, previousRequest: string, data: object) => string | void | Buffer | Promise<string | Buffer>;
@@ -1,7 +1,10 @@
1
+ export interface ModuleFederationRuntimeOptions {
2
+ entryRuntime?: string;
3
+ }
1
4
  export declare const ModuleFederationRuntimePlugin: {
2
- new (): {
5
+ new (options?: ModuleFederationRuntimeOptions | undefined): {
3
6
  name: string;
4
- _args: [];
7
+ _args: [options?: ModuleFederationRuntimeOptions | undefined];
5
8
  affectedHooks: "done" | "compilation" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
6
9
  raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
7
10
  apply(compiler: import("..").Compiler): void;
@@ -0,0 +1,4 @@
1
+ export * from "./ContainerPlugin";
2
+ export * from "./ContainerReferencePlugin";
3
+ export * from "./ModuleFederationPlugin";
4
+ export * from "./ModuleFederationPluginV1";
@@ -79,7 +79,7 @@ let pitch = function(request, _, data) {
79
79
  e.stack = void 0, this.emitWarning(e);
80
80
  return;
81
81
  }
82
- let options = this.getOptions(), emit = void 0 === options.emit || options.emit, callback = this.async(), filepath = this.resourcePath, parseMeta = this.__internal__parseMeta;
82
+ let options = this.getOptions(), emit = void 0 === options.emit || options.emit, callback = this.async(), filepath = this.resourcePath;
83
83
  this.addDependency(filepath);
84
84
  let { publicPath } = this._compilation.outputOptions;
85
85
  "string" == typeof options.publicPath ? publicPath = options.publicPath : "function" == typeof options.publicPath && (publicPath = options.publicPath(this.resourcePath, this.rootContext)), "auto" === publicPath && (publicPath = AUTO_PUBLIC_PATH), publicPathForExtract = "string" == typeof publicPath ? /^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(publicPath) ? publicPath : `${ABSOLUTE_PUBLIC_PATH}${publicPath.replace(/\./g, SINGLE_DOT_PATH_SEGMENT)}` : publicPath, this.importModule(`${this.resourcePath}.webpack[javascript/auto]!=!!!${request}`, {
@@ -138,7 +138,7 @@ let pitch = function(request, _, data) {
138
138
  loaderContext: this,
139
139
  options,
140
140
  locals: locals
141
- }) : result, dependencies.length > 0 && (parseMeta[PLUGIN_NAME] = JSON.stringify(dependencies)), callback(null, resultSource, void 0, data);
141
+ }) : result, dependencies.length > 0 && this.__internal__setParseMeta(PLUGIN_NAME, JSON.stringify(dependencies)), callback(null, resultSource, void 0, data);
142
142
  })(exports1);
143
143
  });
144
144
  }, css_extract_loader = function(content) {