@rspack/core 2.0.2 → 2.0.4

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.
Files changed (40) hide show
  1. package/compiled/http-proxy-middleware/index.d.ts +4 -4
  2. package/compiled/http-proxy-middleware/package.json +1 -1
  3. package/dist/Compilation.d.ts +1 -1
  4. package/dist/MultiCompiler.d.ts +1 -1
  5. package/dist/RuntimeGlobals.d.ts +1 -1
  6. package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +7 -0
  7. package/dist/builtin-plugin/CssHttpExternalsRspackPlugin.d.ts +9 -0
  8. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
  9. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
  10. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
  11. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
  12. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +2 -2
  13. package/dist/builtin-plugin/HttpUriPlugin.d.ts +1 -1
  14. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
  15. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
  16. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
  17. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
  18. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
  19. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
  20. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +2 -2
  21. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +1 -1
  22. package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -1
  23. package/dist/builtin-plugin/index.d.ts +2 -0
  24. package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +7 -0
  25. package/dist/builtin-plugin/rsc/index.d.ts +3 -3
  26. package/dist/config/target.d.ts +1 -1
  27. package/dist/config/types.d.ts +33 -29
  28. package/dist/exports.d.ts +1 -1
  29. package/dist/index.js +121 -96
  30. package/dist/lib/CacheFacade.d.ts +1 -1
  31. package/dist/runtime/cssExtractHmr.d.ts +2 -2
  32. package/dist/runtime/moduleFederationDefaultRuntime.d.ts +1 -1
  33. package/dist/sharing/ConsumeSharedPlugin.d.ts +2 -2
  34. package/dist/sharing/ProvideSharedPlugin.d.ts +4 -4
  35. package/dist/sharing/SharePlugin.d.ts +4 -4
  36. package/dist/util/comparators.d.ts +1 -1
  37. package/dist/util/createHash.d.ts +1 -1
  38. package/dist/util/identifier.d.ts +35 -8
  39. package/module.d.ts +6 -0
  40. package/package.json +7 -7
@@ -182,7 +182,7 @@ interface Options<TReq extends http.IncomingMessage = http.IncomingMessage, TRes
182
182
  */
183
183
  pathRewrite?: PathRewriteConfig<TReq>;
184
184
  /**
185
- * Access the internal http-proxy server instance to customize behavior
185
+ * Access the internal `httpxy` server instance to customize behavior
186
186
  *
187
187
  * @example
188
188
  * ```js
@@ -207,7 +207,7 @@ interface Options<TReq extends http.IncomingMessage = http.IncomingMessage, TRes
207
207
  */
208
208
  ejectPlugins?: boolean;
209
209
  /**
210
- * Listen to http-proxy events
210
+ * Listen to `httpxy` events
211
211
  * @see {@link OnProxyEvent} for available events
212
212
  * @example
213
213
  * ```js
@@ -347,7 +347,7 @@ type BodyParserLikeRequest = http.IncomingMessage & {
347
347
  declare function fixRequestBody<TReq extends BodyParserLikeRequest = BodyParserLikeRequest>(proxyReq: http.ClientRequest, req: TReq): void;
348
348
 
349
349
  /**
350
- * Subscribe to {@link https://www.npmjs.com/package/http-proxy#listening-for-proxy-events http-proxy error events} to prevent server from crashing.
350
+ * Subscribe to {@link https://github.com/unjs/httpxy#events `httpxy` error events} to prevent server from crashing.
351
351
  * Errors are logged with {@link https://www.npmjs.com/package/debug debug} library.
352
352
  */
353
353
  declare const debugProxyErrorsPlugin: Plugin;
@@ -357,7 +357,7 @@ declare const errorResponsePlugin: Plugin;
357
357
  declare const loggerPlugin: Plugin;
358
358
 
359
359
  /**
360
- * Implements option.on object to subscribe to http-proxy events.
360
+ * Implements option.on object to subscribe to `httpxy` events.
361
361
  *
362
362
  * @example
363
363
  * ```js
@@ -1 +1 @@
1
- {"name":"http-proxy-middleware","author":"Steven Chim","version":"4.0.0-beta.6","license":"MIT","types":"index.d.ts","type":"module"}
1
+ {"name":"http-proxy-middleware","author":"Steven Chim","version":"4.0.0","license":"MIT","types":"index.d.ts","type":"module"}
@@ -235,7 +235,7 @@ export declare class Compilation {
235
235
  *
236
236
  * Note: This is a proxy for webpack internal API, only method `get`, `keys`, `values` and `entries` are supported now.
237
237
  */
238
- get namedChunks(): ReadonlyMap<string, Readonly<binding.Chunk>>;
238
+ get namedChunks(): ReadonlyMap<string, Readonly<Chunk>>;
239
239
  get entries(): Map<string, EntryData>;
240
240
  get codeGenerationResults(): binding.CodeGenerationResults;
241
241
  getCache(name: string): import("./lib/CacheFacade.js").CacheFacade;
@@ -45,7 +45,7 @@ export declare class MultiCompiler {
45
45
  get options(): import("./config/index.js").RspackOptionsNormalized[] & MultiCompilerOptions;
46
46
  get outputPath(): string;
47
47
  get inputFileSystem(): InputFileSystem;
48
- get outputFileSystem(): typeof import("fs");
48
+ get outputFileSystem(): typeof import('fs');
49
49
  get watchFileSystem(): WatchFileSystem;
50
50
  get intermediateFileSystem(): IntermediateFileSystem;
51
51
  set inputFileSystem(value: InputFileSystem);
@@ -352,5 +352,5 @@ export declare enum RuntimeVariable {
352
352
  }
353
353
  export declare function renderRuntimeVariables(variable: RuntimeVariable, _compilerOptions?: RspackOptionsNormalized): string;
354
354
  export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): Record<keyof typeof RuntimeGlobals, string>;
355
- declare const DefaultRuntimeGlobals: Record<"module" | "publicPath" | "chunkName" | "moduleId" | "exports" | "require" | "global" | "system" | "requireScope" | "thisAsExports" | "returnExportsFromRuntime" | "moduleLoaded" | "entryModuleId" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "definePropertyGetters" | "makeNamespaceObject" | "createFakeNamespaceObject" | "compatGetDefaultExport" | "harmonyModuleDecorator" | "nodeModuleDecorator" | "getFullHash" | "wasmInstances" | "instantiateWasm" | "uncaughtErrorHandler" | "scriptNonce" | "loadScript" | "createScript" | "createScriptUrl" | "getTrustedTypesPolicy" | "hasFetchPriority" | "runtimeId" | "getChunkScriptFilename" | "getChunkCssFilename" | "rspackVersion" | "hasCssModules" | "rspackUniqueId" | "getChunkUpdateScriptFilename" | "getChunkUpdateCssFilename" | "startup" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "chunkCallback" | "startupEntrypoint" | "startupChunkDependencies" | "onChunksLoaded" | "externalInstallChunk" | "interceptModuleExecution" | "shareScopeMap" | "initializeSharing" | "currentRemoteGetScope" | "getUpdateManifestFilename" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrModuleData" | "hmrInvalidateModuleHandlers" | "hmrRuntimeStatePrefix" | "amdDefine" | "amdOptions" | "hasOwnProperty" | "systemContext" | "baseURI" | "relativeUrl" | "asyncModule" | "asyncModuleExportSymbol" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol", string>;
355
+ declare const DefaultRuntimeGlobals: Record<"amdDefine" | "amdOptions" | "asyncModule" | "asyncModuleExportSymbol" | "baseURI" | "chunkCallback" | "chunkName" | "compatGetDefaultExport" | "createFakeNamespaceObject" | "createScript" | "createScriptUrl" | "currentRemoteGetScope" | "definePropertyGetters" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "entryModuleId" | "exports" | "externalInstallChunk" | "getChunkCssFilename" | "getChunkScriptFilename" | "getChunkUpdateCssFilename" | "getChunkUpdateScriptFilename" | "getFullHash" | "getTrustedTypesPolicy" | "getUpdateManifestFilename" | "global" | "harmonyModuleDecorator" | "hasCssModules" | "hasFetchPriority" | "hasOwnProperty" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrInvalidateModuleHandlers" | "hmrModuleData" | "hmrRuntimeStatePrefix" | "initializeSharing" | "instantiateWasm" | "interceptModuleExecution" | "loadScript" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol" | "makeNamespaceObject" | "module" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "moduleId" | "moduleLoaded" | "nodeModuleDecorator" | "onChunksLoaded" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "publicPath" | "relativeUrl" | "require" | "requireScope" | "returnExportsFromRuntime" | "rspackUniqueId" | "rspackVersion" | "runtimeId" | "scriptNonce" | "shareScopeMap" | "startup" | "startupChunkDependencies" | "startupEntrypoint" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "system" | "systemContext" | "thisAsExports" | "uncaughtErrorHandler" | "wasmInstances", string>;
356
356
  export { DefaultRuntimeGlobals as RuntimeGlobals };
@@ -0,0 +1,7 @@
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
+ import type { Compiler } from '../Compiler.js';
3
+ import { RspackBuiltinPlugin } from './base.js';
4
+ export declare class CircularModulesInfoPlugin extends RspackBuiltinPlugin {
5
+ name: BuiltinPluginName;
6
+ raw(_compiler: Compiler): BuiltinPlugin;
7
+ }
@@ -0,0 +1,9 @@
1
+ export declare const CssHttpExternalsRspackPlugin: {
2
+ new (): {
3
+ name: string;
4
+ _args: [];
5
+ affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
6
+ raw(compiler: import("../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
7
+ apply(compiler: import("../index.js").Compiler): void;
8
+ };
9
+ };
@@ -2,6 +2,6 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class DeterministicChunkIdsPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
5
- affectedHooks: "compilation";
5
+ affectedHooks: 'compilation';
6
6
  raw(): BuiltinPlugin;
7
7
  }
@@ -2,6 +2,6 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class DeterministicModuleIdsPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
5
- affectedHooks: "compilation";
5
+ affectedHooks: 'compilation';
6
6
  raw(): BuiltinPlugin;
7
7
  }
@@ -6,7 +6,7 @@ export declare class DynamicEntryPlugin extends RspackBuiltinPlugin {
6
6
  private context;
7
7
  private entry;
8
8
  name: BuiltinPluginName;
9
- affectedHooks: "make";
9
+ affectedHooks: 'make';
10
10
  constructor(context: string, entry: EntryDynamicNormalized);
11
11
  raw(compiler: Compiler): BuiltinPlugin | undefined;
12
12
  }
@@ -3,7 +3,7 @@ import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
4
4
  private global;
5
5
  name: BuiltinPluginName;
6
- affectedHooks: "compilation";
6
+ affectedHooks: 'compilation';
7
7
  constructor(global: boolean);
8
8
  raw(): BuiltinPlugin;
9
9
  }
@@ -1,7 +1,7 @@
1
1
  export declare const HttpExternalsRspackPlugin: {
2
- new (css: boolean, webAsync: boolean): {
2
+ new (webAsync: boolean): {
3
3
  name: string;
4
- _args: [css: boolean, webAsync: boolean];
4
+ _args: [webAsync: boolean];
5
5
  affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
6
6
  raw(compiler: import("../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
7
7
  apply(compiler: import("../index.js").Compiler): void;
@@ -30,7 +30,7 @@ export type HttpUriPluginOptions = {
30
30
  export declare class HttpUriPlugin extends RspackBuiltinPlugin {
31
31
  private options;
32
32
  name: BuiltinPluginName;
33
- affectedHooks: "compilation";
33
+ affectedHooks: 'compilation';
34
34
  constructor(options: HttpUriPluginOptions);
35
35
  raw(compiler: Compiler): BuiltinPlugin | undefined;
36
36
  }
@@ -9,7 +9,7 @@ export type CompilationHooks = {
9
9
  };
10
10
  export declare class JavascriptModulesPlugin extends RspackBuiltinPlugin {
11
11
  name: BuiltinPluginName;
12
- affectedHooks: "compilation";
12
+ affectedHooks: 'compilation';
13
13
  raw(): BuiltinPlugin;
14
14
  static getCompilationHooks(compilation: Compilation): CompilationHooks;
15
15
  }
@@ -3,7 +3,7 @@ import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class MangleExportsPlugin extends RspackBuiltinPlugin {
4
4
  private deterministic;
5
5
  name: BuiltinPluginName;
6
- affectedHooks: "compilation";
6
+ affectedHooks: 'compilation';
7
7
  constructor(deterministic: boolean);
8
8
  raw(): BuiltinPlugin;
9
9
  }
@@ -2,6 +2,6 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class ModuleConcatenationPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
5
- affectedHooks: "compilation";
5
+ affectedHooks: 'compilation';
6
6
  raw(): BuiltinPlugin;
7
7
  }
@@ -2,6 +2,6 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class NaturalChunkIdsPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
5
- affectedHooks: "compilation";
5
+ affectedHooks: 'compilation';
6
6
  raw(): BuiltinPlugin;
7
7
  }
@@ -2,6 +2,6 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
2
  import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class NaturalModuleIdsPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
5
- affectedHooks: "compilation";
5
+ affectedHooks: 'compilation';
6
6
  raw(): BuiltinPlugin;
7
7
  }
@@ -3,7 +3,7 @@ import { RspackBuiltinPlugin } from './base.js';
3
3
  export declare class SideEffectsFlagPlugin extends RspackBuiltinPlugin {
4
4
  private analyzeSideEffectsFree;
5
5
  name: BuiltinPluginName;
6
- affectedHooks: "compilation";
6
+ affectedHooks: 'compilation';
7
7
  constructor(analyzeSideEffectsFree?: boolean);
8
8
  raw(): BuiltinPlugin;
9
9
  }
@@ -1,14 +1,14 @@
1
1
  export declare const SizeLimitsPlugin: {
2
2
  new (options: {
3
3
  assetFilter?: (assetFilename: string) => boolean;
4
- hints?: false | "warning" | "error";
4
+ hints?: false | 'warning' | 'error';
5
5
  maxAssetSize?: number;
6
6
  maxEntrypointSize?: number;
7
7
  }): {
8
8
  name: string;
9
9
  _args: [options: {
10
10
  assetFilter?: (assetFilename: string) => boolean;
11
- hints?: false | "warning" | "error";
11
+ hints?: false | 'warning' | 'error';
12
12
  maxAssetSize?: number;
13
13
  maxEntrypointSize?: number;
14
14
  }];
@@ -5,7 +5,7 @@ import { RspackBuiltinPlugin } from './base.js';
5
5
  export declare class SplitChunksPlugin extends RspackBuiltinPlugin {
6
6
  private options;
7
7
  name: BuiltinPluginName;
8
- affectedHooks: "thisCompilation";
8
+ affectedHooks: 'thisCompilation';
9
9
  constructor(options: OptimizationSplitChunksOptions);
10
10
  raw(compiler: Compiler): BuiltinPlugin;
11
11
  }
@@ -8,7 +8,7 @@ export declare class WorkerPlugin extends RspackBuiltinPlugin {
8
8
  private module;
9
9
  private workerPublicPath;
10
10
  name: BuiltinPluginName;
11
- affectedHooks: "compilation";
11
+ affectedHooks: 'compilation';
12
12
  constructor(chunkLoading: ChunkLoading, wasmLoading: WasmLoading, module: OutputModule, workerPublicPath: WorkerPublicPath);
13
13
  raw(compiler: Compiler): BuiltinPlugin;
14
14
  }
@@ -7,11 +7,13 @@ export * from './BundlerInfoRspackPlugin.js';
7
7
  export { createNativePlugin, RspackBuiltinPlugin } from './base.js';
8
8
  export * from './CaseSensitivePlugin.js';
9
9
  export * from './ChunkPrefetchPreloadPlugin.js';
10
+ export * from './CircularModulesInfoPlugin.js';
10
11
  export * from './CircularDependencyRspackPlugin.js';
11
12
  export * from './CommonJsChunkFormatPlugin.js';
12
13
  export * from './ContextReplacementPlugin.js';
13
14
  export * from './CopyRspackPlugin.js';
14
15
  export * from './CssChunkingPlugin.js';
16
+ export * from './CssHttpExternalsRspackPlugin.js';
15
17
  export * from './CssModulesPlugin.js';
16
18
  export * from './css-extract/index.js';
17
19
  export * from './DataUriPlugin.js';
@@ -24,11 +24,18 @@ export interface RscManifestPerEntry {
24
24
  moduleLoading: RscModuleLoading;
25
25
  entryCssFiles: Record<string, string[]>;
26
26
  entryJsFiles: string[];
27
+ cssLinkProps: RscCssLinkProps;
27
28
  }
28
29
  /** Full RSC manifest (all entries) passed to onManifest. Map from entry name to per-entry manifest. */
29
30
  export type RscManifest = Record<string, RscManifestPerEntry>;
31
+ export type RscCssLinkProps = Record<string, string>;
32
+ export type RscCssLinkOptions = {
33
+ precedence?: string | false;
34
+ props?: RscCssLinkProps;
35
+ };
30
36
  export type RscServerPluginOptions = {
31
37
  coordinator: Coordinator;
38
+ cssLink?: RscCssLinkOptions | null;
32
39
  onServerComponentChanges?: () => void | Promise<void>;
33
40
  onManifest?: (manifest: RscManifest) => void | Promise<void>;
34
41
  };
@@ -7,18 +7,18 @@ declare class ClientPlugin extends RscClientPlugin {
7
7
  }
8
8
  export declare const rsc: {
9
9
  createPlugins: () => {
10
- ServerPlugin: new (options?: Omit<RscServerPluginOptions, "coordinator">) => ServerPlugin;
10
+ ServerPlugin: new (options?: Omit<RscServerPluginOptions, 'coordinator'>) => ServerPlugin;
11
11
  ClientPlugin: new () => ClientPlugin;
12
12
  };
13
13
  Layers: {
14
14
  /**
15
15
  * The layer for server-only runtime and picking up `react-server` export conditions.
16
16
  */
17
- readonly rsc: "react-server-components";
17
+ readonly rsc: 'react-server-components';
18
18
  /**
19
19
  * Server Side Rendering layer for app.
20
20
  */
21
- readonly ssr: "server-side-rendering";
21
+ readonly ssr: 'server-side-rendering';
22
22
  };
23
23
  };
24
24
  export {};
@@ -11,7 +11,7 @@
11
11
  * @param context the context directory
12
12
  * @returns default target
13
13
  */
14
- export declare const getDefaultTarget: (context: string) => "browserslist" | "web";
14
+ export declare const getDefaultTarget: (context: string) => 'browserslist' | 'web';
15
15
  export type PlatformTargetProperties = {
16
16
  /** web platform, importing of http(s) and std: is available */
17
17
  web?: boolean | null;
@@ -189,7 +189,7 @@ export type Clean = boolean | {
189
189
  export type OutputModule = boolean;
190
190
  /** Tell Rspack to remove a module from the module instance cache (require.cache) if it throws an exception when it is required. */
191
191
  export type StrictModuleExceptionHandling = boolean;
192
- /** Handle error in module loading as per EcmaScript Modules spec at a performance cost. */
192
+ /** Handle error in module loading as per ECMAScript Modules spec at a performance cost. */
193
193
  export type StrictModuleErrorHandling = boolean;
194
194
  /** Indicates what global object will be used to mount the library. */
195
195
  export type GlobalObject = string;
@@ -272,7 +272,7 @@ export type Environment = {
272
272
  destructuring?: boolean;
273
273
  /** The environment supports 'document' variable. */
274
274
  document?: boolean;
275
- /** The environment supports an async import() function to import EcmaScript modules. */
275
+ /** The environment supports an async import() function to import ECMAScript modules. */
276
276
  dynamicImport?: boolean;
277
277
  /** The environment supports an async import() when creating a worker, only for web targets at the moment. */
278
278
  dynamicImportInWorker?: boolean;
@@ -373,7 +373,7 @@ export type Output = {
373
373
  /** Tell Rspack to remove a module from the module instance cache (require.cache) if it throws an exception when it is required. */
374
374
  strictModuleExceptionHandling?: StrictModuleExceptionHandling;
375
375
  /**
376
- * Handle error in module loading as per EcmaScript Modules spec at a performance cost.
376
+ * Handle error in module loading as per ECMAScript Modules spec at a performance cost.
377
377
  * @default false
378
378
  * */
379
379
  strictModuleErrorHandling?: StrictModuleErrorHandling;
@@ -758,25 +758,7 @@ export type CssParserOptions = {
758
758
  * */
759
759
  resolveImport?: CssParserResolveImport;
760
760
  };
761
- /** Options object for `css/auto` modules. */
762
- export type CssAutoParserOptions = {
763
- /**
764
- * Use ES modules named export for CSS exports.
765
- * @default true
766
- * */
767
- namedExports?: CssParserNamedExports;
768
- /**
769
- * Allow to enable/disables handling the CSS functions url.
770
- * @default true
771
- * */
772
- url?: CssParserUrl;
773
- /**
774
- * Allow to enable/disables `@import` at-rules handling.
775
- * @default true
776
- * */
777
- resolveImport?: CssParserResolveImport;
778
- };
779
- /** Options object for `css/module` modules. */
761
+ /** Options object for `css/auto`, `css/global` and `css/module` modules. */
780
762
  export type CssModuleParserOptions = {
781
763
  /**
782
764
  * Use ES modules named export for CSS exports.
@@ -936,7 +918,9 @@ export type ParserOptionsByModuleTypeKnown = {
936
918
  /** Parser options for `css` modules. */
937
919
  css?: CssParserOptions;
938
920
  /** Parser options for `css/auto` modules. */
939
- 'css/auto'?: CssAutoParserOptions;
921
+ 'css/auto'?: CssModuleParserOptions;
922
+ /** Parser options for `css/global` modules. */
923
+ 'css/global'?: CssModuleParserOptions;
940
924
  /** Parser options for `css/module` modules. */
941
925
  'css/module'?: CssModuleParserOptions;
942
926
  /** Parser options for `javascript` modules. */
@@ -1014,6 +998,10 @@ export type CssGeneratorExportsConvention = 'as-is' | 'camel-case' | 'camel-case
1014
998
  export type CssGeneratorExportsOnly = boolean;
1015
999
  export type CssGeneratorLocalIdentName = string;
1016
1000
  export type CssGeneratorEsModule = boolean;
1001
+ export type CssGeneratorLocalIdentHashDigest = string;
1002
+ export type CssGeneratorLocalIdentHashDigestLength = number;
1003
+ export type CssGeneratorLocalIdentHashFunction = string;
1004
+ export type CssGeneratorLocalIdentHashSalt = string;
1017
1005
  /** Generator options for css modules. */
1018
1006
  export type CssGeneratorOptions = {
1019
1007
  /**
@@ -1024,8 +1012,8 @@ export type CssGeneratorOptions = {
1024
1012
  /** This configuration is available for improved ESM-CJS interoperability purposes. */
1025
1013
  esModule?: CssGeneratorEsModule;
1026
1014
  };
1027
- /** Generator options for css/auto modules. */
1028
- export type CssAutoGeneratorOptions = {
1015
+ /** Generator options for css/auto, css/global and css/module modules. */
1016
+ export type CssModuleGeneratorOptions = {
1029
1017
  /**
1030
1018
  * Customize how CSS export names are exported to javascript modules
1031
1019
  * @default 'as-is'
@@ -1036,13 +1024,27 @@ export type CssAutoGeneratorOptions = {
1036
1024
  * If false, generate stylesheets and embed them in the template.
1037
1025
  */
1038
1026
  exportsOnly?: CssGeneratorExportsOnly;
1027
+ /**
1028
+ * Digest types used for the hash.
1029
+ */
1030
+ localIdentHashDigest?: CssGeneratorLocalIdentHashDigest;
1031
+ /**
1032
+ * Number of chars which are used for the hash.
1033
+ */
1034
+ localIdentHashDigestLength?: CssGeneratorLocalIdentHashDigestLength;
1035
+ /**
1036
+ * Algorithm used for generation the hash.
1037
+ */
1038
+ localIdentHashFunction?: CssGeneratorLocalIdentHashFunction;
1039
+ /**
1040
+ * Any string which is added to the hash to salt it.
1041
+ */
1042
+ localIdentHashSalt?: CssGeneratorLocalIdentHashSalt;
1039
1043
  /** Customize the format of the local class names generated for CSS modules */
1040
1044
  localIdentName?: CssGeneratorLocalIdentName;
1041
1045
  /** This configuration is available for improved ESM-CJS interoperability purposes. */
1042
1046
  esModule?: CssGeneratorEsModule;
1043
1047
  };
1044
- /** Generator options for css/module modules. */
1045
- export type CssModuleGeneratorOptions = CssAutoGeneratorOptions;
1046
1048
  /** Generator options for json modules. */
1047
1049
  export type JsonGeneratorOptions = {
1048
1050
  /**
@@ -1061,7 +1063,9 @@ export type GeneratorOptionsByModuleTypeKnown = {
1061
1063
  /** Generator options for css modules. */
1062
1064
  css?: CssGeneratorOptions;
1063
1065
  /** Generator options for css/auto modules. */
1064
- 'css/auto'?: CssAutoGeneratorOptions;
1066
+ 'css/auto'?: CssModuleGeneratorOptions;
1067
+ /** Generator options for css/global modules. */
1068
+ 'css/global'?: CssModuleGeneratorOptions;
1065
1069
  /** Generator options for css/module modules. */
1066
1070
  'css/module'?: CssModuleGeneratorOptions;
1067
1071
  /** Generator options for json modules. */
@@ -1099,7 +1103,7 @@ export type Target = false | AllowTarget | AllowTarget[];
1099
1103
  * `amd`, `umd`, `system` and `jsonp` externals depend on the `output.library.type` being set to the same value e.g. you can only consume amd externals within an amd library.
1100
1104
  * @default 'var'
1101
1105
  */
1102
- export type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'module-import' | 'script' | 'node-commonjs' | 'commonjs-import';
1106
+ export type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'module-import' | 'modern-module' | 'script' | 'node-commonjs' | 'commonjs-import';
1103
1107
  /**
1104
1108
  * External item object when both library.type and externalsType is 'umd'
1105
1109
  */
package/dist/exports.d.ts CHANGED
@@ -44,7 +44,7 @@ type Config = {
44
44
  export declare const config: Config;
45
45
  export type * from './config/index.js';
46
46
  export declare const util: {
47
- createHash: (algorithm: "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => import("./util/hash/index.js").default)) => import("./util/hash/index.js").default;
47
+ createHash: (algorithm: 'xxhash64' | 'md4' | 'native-md4' | (string & {}) | (new () => import("./util/hash/index.js").default)) => import("./util/hash/index.js").default;
48
48
  cleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
49
49
  };
50
50
  export type { BannerPluginArgument, DefinePluginOptions, EntryOptions, ProgressPluginHandlerInfo, ProgressPluginOptions, ProvidePluginOptions, } from './builtin-plugin/index.js';