@umijs/bundler-webpack 4.0.28 → 4.0.29

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,7 +1,6 @@
1
1
  // Type definitions for json-schema 4.0, 6.0 and 7.0
2
2
  // Project: https://github.com/kriszyp/json-schema
3
3
  // Definitions by: Boris Cherny <https://github.com/bcherny>
4
- // Cyrille Tuzi <https://github.com/cyrilletuzi>
5
4
  // Lucian Buzzo <https://github.com/lucianbuzzo>
6
5
  // Roland Groza <https://github.com/rolandjitsu>
7
6
  // Jason Kwok <https://github.com/JasonHK>
@@ -621,6 +620,14 @@ export interface JSONSchema7 {
621
620
  $schema?: JSONSchema7Version | undefined;
622
621
  $comment?: string | undefined;
623
622
 
623
+ /**
624
+ * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
625
+ * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
626
+ */
627
+ $defs?: {
628
+ [key: string]: JSONSchema7Definition;
629
+ } | undefined;
630
+
624
631
  /**
625
632
  * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
626
633
  */
@@ -1 +1 @@
1
- {"name":"webpack","version":"5.72.1","author":"Tobias Koppers @sokra","license":"MIT","types":"types.d.ts"}
1
+ {"name":"webpack","version":"5.74.0","author":"Tobias Koppers @sokra","license":"MIT","types":"types.d.ts"}
@@ -2503,11 +2503,11 @@ declare interface ContextHash {
2503
2503
  }
2504
2504
  type ContextMode =
2505
2505
  | "weak"
2506
- | "sync"
2507
2506
  | "eager"
2508
- | "async-weak"
2509
2507
  | "lazy"
2510
- | "lazy-once";
2508
+ | "lazy-once"
2509
+ | "sync"
2510
+ | "async-weak";
2511
2511
  declare abstract class ContextModuleFactory extends ModuleFactory {
2512
2512
  hooks: Readonly<{
2513
2513
  beforeResolve: AsyncSeriesWaterfallHook<[any]>;
@@ -3847,6 +3847,13 @@ declare interface ExpressionExpressionInfo {
3847
3847
  getMembers: () => string[];
3848
3848
  getMembersOptionals: () => boolean[];
3849
3849
  }
3850
+ declare interface ExtensionAliasOption {
3851
+ alias: string | string[];
3852
+ extension: string;
3853
+ }
3854
+ declare interface ExtensionAliasOptions {
3855
+ [index: string]: string | string[];
3856
+ }
3850
3857
  type ExternalItem =
3851
3858
  | string
3852
3859
  | RegExp
@@ -4502,6 +4509,42 @@ declare interface HandleModuleCreationOptions {
4502
4509
  */
4503
4510
  connectOrigin?: boolean;
4504
4511
  }
4512
+ declare class HarmonyImportDependency extends ModuleDependency {
4513
+ constructor(
4514
+ request: string,
4515
+ sourceOrder: number,
4516
+ assertions?: Record<string, any>
4517
+ );
4518
+ sourceOrder: number;
4519
+ getImportVar(moduleGraph: ModuleGraph): string;
4520
+ getImportStatement(
4521
+ update: boolean,
4522
+ __1: DependencyTemplateContext
4523
+ ): [string, string];
4524
+ getLinkingErrors(
4525
+ moduleGraph: ModuleGraph,
4526
+ ids: string[],
4527
+ additionalMessage: string
4528
+ ): undefined | WebpackError[];
4529
+ static Template: typeof HarmonyImportDependencyTemplate;
4530
+ static ExportPresenceModes: {
4531
+ NONE: 0;
4532
+ WARN: 1;
4533
+ AUTO: 2;
4534
+ ERROR: 3;
4535
+ fromUserOption(str?: any): 0 | 1 | 2 | 3;
4536
+ };
4537
+ static NO_EXPORTS_REFERENCED: string[][];
4538
+ static EXPORTS_OBJECT_REFERENCED: string[][];
4539
+ static TRANSITIVE: typeof TRANSITIVE;
4540
+ }
4541
+ declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
4542
+ constructor();
4543
+ static getImportEmittedRuntime(
4544
+ module: Module,
4545
+ referencedModule: Module
4546
+ ): undefined | string | boolean | SortableSet<string>;
4547
+ }
4505
4548
  declare class Hash {
4506
4549
  constructor();
4507
4550
 
@@ -4902,6 +4945,15 @@ declare class JavascriptParser extends Parser {
4902
4945
  undefined | null | BasicEvaluatedExpression
4903
4946
  >
4904
4947
  >;
4948
+ evaluateNewExpression: HookMap<
4949
+ SyncBailHook<[NewExpression], undefined | null | BasicEvaluatedExpression>
4950
+ >;
4951
+ evaluateCallExpression: HookMap<
4952
+ SyncBailHook<
4953
+ [CallExpression],
4954
+ undefined | null | BasicEvaluatedExpression
4955
+ >
4956
+ >;
4905
4957
  evaluateCallExpressionMember: HookMap<
4906
4958
  SyncBailHook<
4907
4959
  [CallExpression, undefined | BasicEvaluatedExpression],
@@ -5410,6 +5462,7 @@ declare class JavascriptParser extends Parser {
5410
5462
  isVariableDefined(name?: any): boolean;
5411
5463
  getVariableInfo(name: string): ExportedVariableInfo;
5412
5464
  setVariable(name: string, variableInfo: ExportedVariableInfo): void;
5465
+ evaluatedVariable(tagInfo?: any): VariableInfo;
5413
5466
  parseCommentOptions(
5414
5467
  range?: any
5415
5468
  ): { options: null; errors: null } | { options: object; errors: unknown[] };
@@ -5490,6 +5543,26 @@ declare interface JavascriptParserOptions {
5490
5543
  */
5491
5544
  commonjsMagicComments?: boolean;
5492
5545
 
5546
+ /**
5547
+ * Enable/disable parsing "import { createRequire } from 'module'" and evaluating createRequire().
5548
+ */
5549
+ createRequire?: string | boolean;
5550
+
5551
+ /**
5552
+ * Specifies global mode for dynamic import.
5553
+ */
5554
+ dynamicImportMode?: "weak" | "eager" | "lazy" | "lazy-once";
5555
+
5556
+ /**
5557
+ * Specifies global prefetch for dynamic import.
5558
+ */
5559
+ dynamicImportPrefetch?: number | boolean;
5560
+
5561
+ /**
5562
+ * Specifies global preload for dynamic import.
5563
+ */
5564
+ dynamicImportPreload?: number | boolean;
5565
+
5493
5566
  /**
5494
5567
  * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
5495
5568
  */
@@ -9544,6 +9617,7 @@ declare interface ResolveOptionsTypes {
9544
9617
  alias: AliasOption[];
9545
9618
  fallback: AliasOption[];
9546
9619
  aliasFields: Set<string | string[]>;
9620
+ extensionAlias: ExtensionAliasOption[];
9547
9621
  cachePredicate: (arg0: ResolveRequest) => boolean;
9548
9622
  cacheWithContext: boolean;
9549
9623
 
@@ -9642,6 +9716,11 @@ declare interface ResolveOptionsWebpackOptions {
9642
9716
  */
9643
9717
  exportsFields?: string[];
9644
9718
 
9719
+ /**
9720
+ * An object which maps extension to extension aliases.
9721
+ */
9722
+ extensionAlias?: { [index: string]: string | string[] };
9723
+
9645
9724
  /**
9646
9725
  * Extensions added to the request when trying to find the file.
9647
9726
  */
@@ -11854,6 +11933,11 @@ declare interface UserResolveOptions {
11854
11933
  */
11855
11934
  fallback?: AliasOption[] | AliasOptions;
11856
11935
 
11936
+ /**
11937
+ * An object which maps extension to extension aliases
11938
+ */
11939
+ extensionAlias?: ExtensionAliasOptions;
11940
+
11857
11941
  /**
11858
11942
  * A list of alias fields in description files
11859
11943
  */
@@ -12691,7 +12775,12 @@ declare namespace exports {
12691
12775
  ) => void;
12692
12776
  }
12693
12777
  export namespace dependencies {
12694
- export { ModuleDependency, ConstDependency, NullDependency };
12778
+ export {
12779
+ ModuleDependency,
12780
+ HarmonyImportDependency,
12781
+ ConstDependency,
12782
+ NullDependency
12783
+ };
12695
12784
  }
12696
12785
  export namespace ids {
12697
12786
  export {
@@ -13063,6 +13152,7 @@ declare namespace exports {
13063
13152
  Asset,
13064
13153
  AssetInfo,
13065
13154
  EntryOptions,
13155
+ PathData,
13066
13156
  AssetEmittedInfo,
13067
13157
  MultiStats,
13068
13158
  ParserState,
package/dist/dev.d.ts CHANGED
@@ -26,6 +26,7 @@ declare type IOpts = {
26
26
  mfsuInclude?: string[];
27
27
  srcCodeCache?: any;
28
28
  startBuildWorker?: (deps: any[]) => Worker;
29
+ onBeforeMiddleware?: Function;
29
30
  } & Pick<IConfigOpts, 'cache' | 'pkg'>;
30
31
  export declare function stripUndefined(obj: any): any;
31
32
  export declare function dev(opts: IOpts): Promise<void>;
package/dist/dev.js CHANGED
@@ -158,7 +158,8 @@ async function dev(opts) {
158
158
  ip: opts.ip,
159
159
  afterMiddlewares: [...opts.afterMiddlewares || []],
160
160
  onDevCompileDone: opts.onDevCompileDone,
161
- onProgress: opts.onProgress
161
+ onProgress: opts.onProgress,
162
+ onBeforeMiddleware: opts.onBeforeMiddleware
162
163
  });
163
164
  }
164
165
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type webpack from '../compiled/webpack';
2
2
  import './requireHook';
3
- export type { RequestHandler } from '@umijs/bundler-utils/compiled/express';
3
+ export type { RequestHandler, Express, } from '@umijs/bundler-utils/compiled/express';
4
4
  export type { Compiler, Stats } from '../compiled/webpack';
5
5
  export * from './build';
6
6
  export * from './config/config';
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { Configuration } from '@umijs/bundler-webpack/compiled/webpack';
3
4
  import http from 'http';
4
5
  import { IConfig } from '../types';
@@ -13,6 +14,7 @@ interface IOpts {
13
14
  afterMiddlewares?: any[];
14
15
  onDevCompileDone?: Function;
15
16
  onProgress?: Function;
17
+ onBeforeMiddleware?: Function;
16
18
  }
17
19
  export declare function createServer(opts: IOpts): Promise<http.Server | import("https").Server | null>;
18
20
  export {};
@@ -58,18 +58,23 @@ async function createServer(opts) {
58
58
  }
59
59
  });
60
60
  (opts.beforeMiddlewares || []).forEach((m) => app.use(m));
61
+ if (opts.onBeforeMiddleware) {
62
+ opts.onBeforeMiddleware(app);
63
+ }
61
64
  const configs = Array.isArray(webpackConfig) ? webpackConfig : [webpackConfig];
62
65
  const progresses = [];
63
66
  if (opts.onProgress) {
64
67
  configs.forEach((config) => {
65
68
  const progress = {
66
69
  percent: 0,
67
- status: "waiting"
70
+ status: "waiting",
71
+ details: []
68
72
  };
69
73
  progresses.push(progress);
70
- config.plugins.push(new import_webpack.default.ProgressPlugin((percent, msg) => {
74
+ config.plugins.push(new import_webpack.default.ProgressPlugin((percent, msg, ...details) => {
71
75
  progress.percent = percent;
72
76
  progress.status = msg;
77
+ progress.details = details;
73
78
  opts.onProgress({ progresses });
74
79
  }));
75
80
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "4.0.28",
3
+ "version": "4.0.29",
4
4
  "description": "@umijs/bundler-webpack",
5
5
  "homepage": "https://github.com/umijs/umi/tree/master/packages/bundler-webpack#readme",
6
6
  "bugs": "https://github.com/umijs/umi/issues",
@@ -34,11 +34,11 @@
34
34
  "@svgr/plugin-jsx": "^6.2.1",
35
35
  "@svgr/plugin-svgo": "^6.2.0",
36
36
  "@types/hapi__joi": "17.1.8",
37
- "@umijs/babel-preset-umi": "4.0.28",
38
- "@umijs/bundler-utils": "4.0.28",
37
+ "@umijs/babel-preset-umi": "4.0.29",
38
+ "@umijs/bundler-utils": "4.0.29",
39
39
  "@umijs/case-sensitive-paths-webpack-plugin": "^1.0.1",
40
- "@umijs/mfsu": "4.0.28",
41
- "@umijs/utils": "4.0.28",
40
+ "@umijs/mfsu": "4.0.29",
41
+ "@umijs/utils": "4.0.29",
42
42
  "cors": "^2.8.5",
43
43
  "css-loader": "6.7.1",
44
44
  "es5-imcompatible-versions": "^0.1.73",
@@ -140,7 +140,8 @@
140
140
  "webpack/lib/NormalModule": "../webpack/NormalModule",
141
141
  "webpack-5-chain": "$$LOCAL",
142
142
  "webpack-sources": "$$LOCAL",
143
- "ws": "$$LOCAL"
143
+ "ws": "$$LOCAL",
144
+ "css-loader": "css-loader"
144
145
  },
145
146
  "noMinify": [
146
147
  "./bundles/webpack/bundle",