@umijs/bundler-webpack 4.0.42 → 4.0.43

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 (84) hide show
  1. package/client/utils/formatWebpackMessages.js +27 -8
  2. package/compiled/babel-loader/index.js +8 -2
  3. package/compiled/babel-loader/package.json +1 -1
  4. package/compiled/less-loader/index.js +1 -1
  5. package/compiled/less-loader/package.json +1 -1
  6. package/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +22 -60
  7. package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +2 -10
  8. package/compiled/mini-css-extract-plugin/index.js +492 -696
  9. package/compiled/mini-css-extract-plugin/loader.js +54 -120
  10. package/compiled/mini-css-extract-plugin/package.json +1 -1
  11. package/compiled/mini-css-extract-plugin/utils.js +27 -44
  12. package/compiled/postcss-loader/index.js +1 -1
  13. package/compiled/postcss-loader/package.json +1 -1
  14. package/compiled/sass-loader/index.js +1 -1
  15. package/compiled/sass-loader/package.json +1 -1
  16. package/compiled/sass-loader/sass.default.dart.js +4 -0
  17. package/compiled/terser/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +90 -0
  18. package/compiled/terser/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +12 -0
  19. package/compiled/terser/@jridgewell/gen-mapping/dist/types/types.d.ts +35 -0
  20. package/compiled/terser/@jridgewell/source-map/dist/types/source-map.d.ts +25 -0
  21. package/compiled/terser/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
  22. package/compiled/terser/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
  23. package/compiled/terser/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
  24. package/compiled/terser/index.js +1 -1
  25. package/compiled/terser/package.json +1 -1
  26. package/compiled/terser/tools/terser.d.ts +6 -3
  27. package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
  28. package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
  29. package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
  30. package/compiled/terser-webpack-plugin/index.js +1211 -3390
  31. package/compiled/terser-webpack-plugin/package.json +1 -1
  32. package/compiled/terser-webpack-plugin/types/index.d.ts +10 -10
  33. package/compiled/terser-webpack-plugin/types/utils.d.ts +10 -9
  34. package/compiled/terser-webpack-plugin/utils.js +36 -10
  35. package/compiled/webpack/package.json +1 -1
  36. package/compiled/webpack/types.d.ts +137 -126
  37. package/compiled/webpack-5-chain/index.js +1 -1
  38. package/compiled/webpack-5-chain/package.json +1 -1
  39. package/compiled/webpack-5-chain/types/index.d.ts +76 -20
  40. package/compiled/webpack-bundle-analyzer/index.js +7 -6
  41. package/compiled/webpack-bundle-analyzer/package.json +1 -1
  42. package/compiled/webpack-bundle-analyzer/public/viewer.js +2 -2
  43. package/compiled/webpack-bundle-analyzer/public/viewer.js.map +1 -1
  44. package/compiled/webpack-dev-middleware/index.js +5 -5
  45. package/compiled/webpack-dev-middleware/package.json +1 -1
  46. package/compiled/ws/LICENSE +13 -12
  47. package/compiled/ws/index.d.ts +73 -33
  48. package/compiled/ws/index.js +1 -1
  49. package/compiled/ws/package.json +1 -1
  50. package/dist/build.js +8 -2
  51. package/dist/cli.js +4 -1
  52. package/dist/config/compressPlugin.js +4 -1
  53. package/dist/config/config.js +41 -11
  54. package/dist/config/cssRules.js +17 -5
  55. package/dist/config/detectDeadCode.js +38 -8
  56. package/dist/config/detectDeadCodePlugin.js +8 -2
  57. package/dist/config/fastRefreshPlugin.js +4 -1
  58. package/dist/config/forkTSCheckerPlugin.js +4 -1
  59. package/dist/config/harmonyLinkingErrorPlugin.js +14 -11
  60. package/dist/config/javaScriptRules.js +10 -5
  61. package/dist/config/miniCSSExtractPlugin.js +4 -1
  62. package/dist/config/progressPlugin.js +9 -2
  63. package/dist/config/speedMeasureWebpackPlugin.js +7 -2
  64. package/dist/config/ssrPlugin.js +20 -6
  65. package/dist/config/svgRules.js +4 -1
  66. package/dist/dev.js +29 -10
  67. package/dist/loader/svgr.js +16 -11
  68. package/dist/loader/swc.js +26 -8
  69. package/dist/parcelCSS.js +4 -1
  70. package/dist/plugins/ProgressPlugin.js +6 -2
  71. package/dist/plugins/RuntimePublicPathPlugin.js +9 -6
  72. package/dist/plugins/_SamplePlugin.d.ts +1 -1
  73. package/dist/plugins/_SamplePlugin.js +1 -1
  74. package/dist/requireHook.js +4 -1
  75. package/dist/schema.js +58 -23
  76. package/dist/server/server.d.ts +1 -4
  77. package/dist/server/server.js +37 -23
  78. package/dist/server/ws.js +8 -3
  79. package/dist/swcPlugins/autoCSSModules.js +4 -1
  80. package/dist/swcPlugins/lockCoreJS.js +8 -2
  81. package/dist/types.d.ts +2 -1
  82. package/dist/utils/formatWebpackMessages.js +31 -9
  83. package/dist/utils/getEsBuildTarget.js +7 -1
  84. package/package.json +25 -24
@@ -1 +1 @@
1
- {"name":"terser","author":"Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)","license":"BSD-2-Clause","types":"tools/terser.d.ts"}
1
+ {"name":"terser","version":"5.16.1","author":"Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)","license":"BSD-2-Clause","types":"tools/terser.d.ts"}
@@ -1,11 +1,12 @@
1
1
  /// <reference lib="es2015" />
2
2
 
3
- import { RawSourceMap } from '../source-map';
3
+ import { SectionedSourceMapInput, EncodedSourceMap, DecodedSourceMap } from '../@jridgewell/source-map';
4
4
 
5
5
  export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020;
6
6
 
7
7
  export interface ParseOptions {
8
8
  bare_returns?: boolean;
9
+ /** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
9
10
  ecma?: ECMA;
10
11
  html5_comments?: boolean;
11
12
  shebang?: boolean;
@@ -144,6 +145,7 @@ export interface FormatOptions {
144
145
  }) => boolean );
145
146
  ecma?: ECMA;
146
147
  ie8?: boolean;
148
+ keep_numbers?: boolean;
147
149
  indent_level?: number;
148
150
  indent_start?: number;
149
151
  inline_script?: boolean;
@@ -192,12 +194,13 @@ export interface MinifyOptions {
192
194
 
193
195
  export interface MinifyOutput {
194
196
  code?: string;
195
- map?: RawSourceMap | string;
197
+ map?: EncodedSourceMap | string;
198
+ decoded_map?: DecodedSourceMap | null;
196
199
  }
197
200
 
198
201
  export interface SourceMapOptions {
199
202
  /** Source map object, 'inline' or source map file content */
200
- content?: RawSourceMap | string;
203
+ content?: SectionedSourceMapInput | string;
201
204
  includeSources?: boolean;
202
205
  filename?: string;
203
206
  root?: string;
@@ -0,0 +1,16 @@
1
+ declare type GeneratedColumn = number;
2
+ declare type SourcesIndex = number;
3
+ declare type SourceLine = number;
4
+ declare type SourceColumn = number;
5
+ declare type NamesIndex = number;
6
+ declare type GeneratedLine = number;
7
+ export declare type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];
8
+ export declare type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn];
9
+ export declare const COLUMN = 0;
10
+ export declare const SOURCES_INDEX = 1;
11
+ export declare const SOURCE_LINE = 2;
12
+ export declare const SOURCE_COLUMN = 3;
13
+ export declare const NAMES_INDEX = 4;
14
+ export declare const REV_GENERATED_LINE = 1;
15
+ export declare const REV_GENERATED_COLUMN = 2;
16
+ export {};
@@ -0,0 +1,74 @@
1
+ import type { SourceMapSegment } from './sourcemap-segment';
2
+ import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping } from './types';
3
+ export type { SourceMapSegment } from './sourcemap-segment';
4
+ export type { SourceMapInput, SectionedSourceMapInput, DecodedSourceMap, EncodedSourceMap, SectionedSourceMap, InvalidOriginalMapping, OriginalMapping as Mapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, EachMapping, } from './types';
5
+ export declare const LEAST_UPPER_BOUND = -1;
6
+ export declare const GREATEST_LOWER_BOUND = 1;
7
+ /**
8
+ * Returns the encoded (VLQ string) form of the SourceMap's mappings field.
9
+ */
10
+ export declare let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings'];
11
+ /**
12
+ * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.
13
+ */
14
+ export declare let decodedMappings: (map: TraceMap) => Readonly<DecodedSourceMap['mappings']>;
15
+ /**
16
+ * A low-level API to find the segment associated with a generated line/column (think, from a
17
+ * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.
18
+ */
19
+ export declare let traceSegment: (map: TraceMap, line: number, column: number) => Readonly<SourceMapSegment> | null;
20
+ /**
21
+ * A higher-level API to find the source/line/column associated with a generated line/column
22
+ * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in
23
+ * `source-map` library.
24
+ */
25
+ export declare let originalPositionFor: (map: TraceMap, needle: Needle) => OriginalMapping | InvalidOriginalMapping;
26
+ /**
27
+ * Finds the generated line/column position of the provided source/line/column source position.
28
+ */
29
+ export declare let generatedPositionFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping | InvalidGeneratedMapping;
30
+ /**
31
+ * Finds all generated line/column positions of the provided source/line/column source position.
32
+ */
33
+ export declare let allGeneratedPositionsFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping[];
34
+ /**
35
+ * Iterates each mapping in generated position order.
36
+ */
37
+ export declare let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void;
38
+ /**
39
+ * Retrieves the source content for a particular source, if its found. Returns null if not.
40
+ */
41
+ export declare let sourceContentFor: (map: TraceMap, source: string) => string | null;
42
+ /**
43
+ * A helper that skips sorting of the input map's mappings array, which can be expensive for larger
44
+ * maps.
45
+ */
46
+ export declare let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap;
47
+ /**
48
+ * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
49
+ * a sourcemap, or to JSON.stringify.
50
+ */
51
+ export declare let decodedMap: (map: TraceMap) => Omit<DecodedSourceMap, 'mappings'> & {
52
+ mappings: readonly SourceMapSegment[][];
53
+ };
54
+ /**
55
+ * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
56
+ * a sourcemap, or to JSON.stringify.
57
+ */
58
+ export declare let encodedMap: (map: TraceMap) => EncodedSourceMap;
59
+ export { AnyMap } from './any-map';
60
+ export declare class TraceMap implements SourceMap {
61
+ version: SourceMapV3['version'];
62
+ file: SourceMapV3['file'];
63
+ names: SourceMapV3['names'];
64
+ sourceRoot: SourceMapV3['sourceRoot'];
65
+ sources: SourceMapV3['sources'];
66
+ sourcesContent: SourceMapV3['sourcesContent'];
67
+ resolvedSources: string[];
68
+ private _encoded;
69
+ private _decoded;
70
+ private _decodedMemo;
71
+ private _bySources;
72
+ private _bySourceMemos;
73
+ constructor(map: SourceMapInput, mapUrl?: string | null);
74
+ }
@@ -0,0 +1,92 @@
1
+ import type { SourceMapSegment } from './sourcemap-segment';
2
+ import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping';
3
+ export interface SourceMapV3 {
4
+ file?: string | null;
5
+ names: string[];
6
+ sourceRoot?: string;
7
+ sources: (string | null)[];
8
+ sourcesContent?: (string | null)[];
9
+ version: 3;
10
+ }
11
+ export interface EncodedSourceMap extends SourceMapV3 {
12
+ mappings: string;
13
+ }
14
+ export interface DecodedSourceMap extends SourceMapV3 {
15
+ mappings: SourceMapSegment[][];
16
+ }
17
+ export interface Section {
18
+ offset: {
19
+ line: number;
20
+ column: number;
21
+ };
22
+ map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap;
23
+ }
24
+ export interface SectionedSourceMap {
25
+ file?: string | null;
26
+ sections: Section[];
27
+ version: 3;
28
+ }
29
+ export declare type OriginalMapping = {
30
+ source: string | null;
31
+ line: number;
32
+ column: number;
33
+ name: string | null;
34
+ };
35
+ export declare type InvalidOriginalMapping = {
36
+ source: null;
37
+ line: null;
38
+ column: null;
39
+ name: null;
40
+ };
41
+ export declare type GeneratedMapping = {
42
+ line: number;
43
+ column: number;
44
+ };
45
+ export declare type InvalidGeneratedMapping = {
46
+ line: null;
47
+ column: null;
48
+ };
49
+ export declare type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND;
50
+ export declare type SourceMapInput = string | Ro<EncodedSourceMap> | Ro<DecodedSourceMap> | TraceMap;
51
+ export declare type SectionedSourceMapInput = SourceMapInput | Ro<SectionedSourceMap>;
52
+ export declare type Needle = {
53
+ line: number;
54
+ column: number;
55
+ bias?: Bias;
56
+ };
57
+ export declare type SourceNeedle = {
58
+ source: string;
59
+ line: number;
60
+ column: number;
61
+ bias?: Bias;
62
+ };
63
+ export declare type EachMapping = {
64
+ generatedLine: number;
65
+ generatedColumn: number;
66
+ source: null;
67
+ originalLine: null;
68
+ originalColumn: null;
69
+ name: null;
70
+ } | {
71
+ generatedLine: number;
72
+ generatedColumn: number;
73
+ source: string | null;
74
+ originalLine: number;
75
+ originalColumn: number;
76
+ name: string | null;
77
+ };
78
+ export declare abstract class SourceMap {
79
+ version: SourceMapV3['version'];
80
+ file: SourceMapV3['file'];
81
+ names: SourceMapV3['names'];
82
+ sourceRoot: SourceMapV3['sourceRoot'];
83
+ sources: SourceMapV3['sources'];
84
+ sourcesContent: SourceMapV3['sourcesContent'];
85
+ resolvedSources: SourceMapV3['sources'];
86
+ }
87
+ export declare type Ro<T> = T extends Array<infer V> ? V[] | Readonly<V[]> | RoArray<V> | Readonly<RoArray<V>> : T extends object ? T | Readonly<T> | RoObject<T> | Readonly<RoObject<T>> : T;
88
+ declare type RoArray<T> = Ro<T>[];
89
+ declare type RoObject<T> = {
90
+ [K in keyof T]: T[K] | Ro<T[K]>;
91
+ };
92
+ export {};