@umijs/bundler-webpack 4.0.0-rc.1 → 4.0.0-rc.10

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 (111) hide show
  1. package/client/client/client.js +49 -35
  2. package/client/constants.js +3 -0
  3. package/compiled/autoprefixer/browserslist/index.d.ts +6 -0
  4. package/compiled/autoprefixer/index.js +3 -3
  5. package/compiled/autoprefixer/postcss/lib/at-rule.d.ts +1 -1
  6. package/compiled/autoprefixer/postcss/lib/comment.d.ts +1 -1
  7. package/compiled/autoprefixer/postcss/lib/declaration.d.ts +2 -2
  8. package/compiled/autoprefixer/postcss/lib/node.d.ts +2 -2
  9. package/compiled/autoprefixer/postcss/lib/rule.d.ts +1 -1
  10. package/compiled/autoprefixer/source-map-js/source-map.d.ts +99 -82
  11. package/compiled/babel-loader/index.js +2 -2
  12. package/compiled/copy-webpack-plugin/939.index.js +1171 -0
  13. package/compiled/copy-webpack-plugin/index.js +16 -10
  14. package/compiled/copy-webpack-plugin/package.json +1 -1
  15. package/compiled/css-minimizer-webpack-plugin/index.js +8 -2
  16. package/compiled/css-minimizer-webpack-plugin/minify.js +25 -11
  17. package/compiled/css-minimizer-webpack-plugin/package.json +1 -1
  18. package/compiled/css-minimizer-webpack-plugin/utils.js +225 -28
  19. package/compiled/cssnano/index.js +12 -11
  20. package/compiled/cssnano/package.json +1 -1
  21. package/compiled/express.d.ts +2 -0
  22. package/compiled/fork-ts-checker-webpack-plugin/index.js +14 -15
  23. package/compiled/http-proxy-middleware/dist/types.d.ts +5 -5
  24. package/compiled/http-proxy-middleware/http-proxy/index.d.ts +1 -1
  25. package/compiled/http-proxy-middleware/index.js +10 -10
  26. package/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +60 -8
  27. package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +13 -1
  28. package/compiled/mini-css-extract-plugin/index.js +4523 -4036
  29. package/compiled/mini-css-extract-plugin/loader.js +179 -54
  30. package/compiled/mini-css-extract-plugin/package.json +1 -1
  31. package/compiled/mini-css-extract-plugin/utils.js +79 -23
  32. package/compiled/sass-loader/index.js +1 -1
  33. package/compiled/terser/index.js +1 -1
  34. package/compiled/terser-webpack-plugin/index.js +296 -297
  35. package/compiled/terser-webpack-plugin/minify.js +4 -2
  36. package/compiled/terser-webpack-plugin/package.json +1 -1
  37. package/compiled/terser-webpack-plugin/types/index.d.ts +180 -146
  38. package/compiled/terser-webpack-plugin/types/minify.d.ts +17 -0
  39. package/compiled/terser-webpack-plugin/types/utils.d.ts +1 -3
  40. package/compiled/terser-webpack-plugin/utils.js +9 -12
  41. package/compiled/webpack/index.js +9855 -4185
  42. package/compiled/webpack-dev-middleware/index.js +7 -7
  43. package/compiled/webpack-dev-middleware/package.json +1 -1
  44. package/compiled/webpack-manifest-plugin/index.js +1 -1
  45. package/compiled/webpack-sources/index.js +1 -1
  46. package/compiled/ws/index.d.ts +1 -2
  47. package/compiled/ws/index.js +1 -1
  48. package/dist/build.d.ts +2 -1
  49. package/dist/build.js +1 -1
  50. package/dist/client/client.js +7 -2
  51. package/dist/config/compressPlugin.js +6 -0
  52. package/dist/config/config.js +4 -3
  53. package/dist/config/cssRules.js +1 -1
  54. package/dist/config/detectDeadCode.d.ts +12 -0
  55. package/dist/config/detectDeadCode.js +120 -0
  56. package/dist/config/detectDeadCodePlugin.d.ts +9 -0
  57. package/dist/config/detectDeadCodePlugin.js +75 -0
  58. package/dist/config/javaScriptRules.js +7 -12
  59. package/dist/constants.d.ts +3 -0
  60. package/dist/constants.js +4 -1
  61. package/dist/dev.d.ts +1 -0
  62. package/dist/dev.js +13 -5
  63. package/dist/index.d.ts +4 -1
  64. package/dist/index.js +5 -1
  65. package/dist/loader/swc.js +14 -18
  66. package/dist/plugins/ESBuildCSSMinifyPlugin.js +1 -3
  67. package/dist/plugins/ParcelCSSMinifyPlugin.d.ts +10 -0
  68. package/dist/plugins/ParcelCSSMinifyPlugin.js +75 -0
  69. package/dist/plugins/ProgressPlugin.js +2 -2
  70. package/dist/plugins/RuntimePublicPathPlugin.js +1 -1
  71. package/dist/requireHook.js +1 -1
  72. package/dist/schema.js +10 -6
  73. package/dist/server/server.d.ts +1 -2
  74. package/dist/server/server.js +27 -11
  75. package/dist/server/ws.d.ts +3 -2
  76. package/dist/swcPlugins/autoCSSModules.d.ts +7 -2
  77. package/dist/swcPlugins/autoCSSModules.js +14 -17
  78. package/dist/swcPlugins/changeImportFromString.d.ts +2 -0
  79. package/dist/swcPlugins/changeImportFromString.js +10 -0
  80. package/dist/swcPlugins/lockCoreJS.d.ts +1 -1
  81. package/dist/swcPlugins/lockCoreJS.js +3 -2
  82. package/dist/types.d.ts +16 -12
  83. package/dist/types.js +1 -0
  84. package/dist/utils/depMatch.js +1 -1
  85. package/dist/utils/server.d.ts +5 -0
  86. package/dist/utils/server.js +93 -0
  87. package/package.json +38 -41
  88. package/compiled/css-loader/LICENSE +0 -20
  89. package/compiled/css-loader/api.js +0 -102
  90. package/compiled/css-loader/getUrl.js +0 -29
  91. package/compiled/css-loader/index.js +0 -2
  92. package/compiled/css-loader/noSourceMaps.js +0 -5
  93. package/compiled/css-loader/package.json +0 -1
  94. package/compiled/css-loader/sourceMaps.js +0 -22
  95. package/compiled/express/LICENSE +0 -24
  96. package/compiled/express/body-parser/index.d.ts +0 -104
  97. package/compiled/express/connect/index.d.ts +0 -93
  98. package/compiled/express/express-serve-static-core/index.d.ts +0 -1252
  99. package/compiled/express/index.d.ts +0 -133
  100. package/compiled/express/index.js +0 -338
  101. package/compiled/express/mime/index.d.ts +0 -35
  102. package/compiled/express/package.json +0 -1
  103. package/compiled/express/qs/index.d.ts +0 -62
  104. package/compiled/express/range-parser/index.d.ts +0 -35
  105. package/compiled/express/serve-static/index.d.ts +0 -108
  106. package/compiled/less/index.js +0 -31
  107. package/compiled/less/package.json +0 -1
  108. package/dist/esbuildHandler/autoCssModules.d.ts +0 -2
  109. package/dist/esbuildHandler/autoCssModules.js +0 -23
  110. package/dist/loader/esbuild.d.ts +0 -5
  111. package/dist/loader/esbuild.js +0 -53
@@ -1,6 +1,6 @@
1
1
  import Container, { ContainerProps } from './container'
2
2
 
3
- interface AtRuleRaws {
3
+ interface AtRuleRaws extends Record<string, unknown> {
4
4
  /**
5
5
  * The space symbols before the node. It also stores `*`
6
6
  * and `_` symbols before the declaration (IE hack).
@@ -1,7 +1,7 @@
1
1
  import Container from './container'
2
2
  import Node, { NodeProps } from './node'
3
3
 
4
- interface CommentRaws {
4
+ interface CommentRaws extends Record<string, unknown> {
5
5
  /**
6
6
  * The space symbols before the node.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  import Container from './container'
2
2
  import Node from './node'
3
3
 
4
- interface DeclarationRaws {
4
+ interface DeclarationRaws extends Record<string, unknown> {
5
5
  /**
6
6
  * The space symbols before the node. It also stores `*`
7
7
  * and `_` symbols before the declaration (IE hack).
@@ -21,7 +21,7 @@ interface DeclarationRaws {
21
21
  /**
22
22
  * Declaration value with comments.
23
23
  */
24
- value: {
24
+ value?: {
25
25
  value: string
26
26
  raw: string
27
27
  }
@@ -3,7 +3,7 @@ import Comment, { CommentProps } from './comment'
3
3
  import { Stringifier, Syntax } from './postcss'
4
4
  import AtRule, { AtRuleProps } from './at-rule'
5
5
  import Rule, { RuleProps } from './rule'
6
- import { WarningOptions } from './warning'
6
+ import Warning, { WarningOptions } from './warning'
7
7
  import CssSyntaxError from './css-syntax-error'
8
8
  import Result from './result'
9
9
  import Input from './input'
@@ -241,7 +241,7 @@ export default abstract class Node {
241
241
  *
242
242
  * @return Created warning object.
243
243
  */
244
- warn(result: Result, text: string, opts?: WarningOptions): void
244
+ warn(result: Result, text: string, opts?: WarningOptions): Warning
245
245
 
246
246
  /**
247
247
  * Removes the node from its parent and cleans the parent properties
@@ -1,6 +1,6 @@
1
1
  import Container, { ContainerProps } from './container'
2
2
 
3
- interface RuleRaws {
3
+ interface RuleRaws extends Record<string, unknown> {
4
4
  /**
5
5
  * The space symbols before the node. It also stores `*`
6
6
  * and `_` symbols before the declaration (IE hack).
@@ -1,98 +1,115 @@
1
- export interface StartOfSourceMap {
2
- file?: string;
3
- sourceRoot?: string;
4
- }
1
+ declare module 'source-map-js' {
2
+ export interface StartOfSourceMap {
3
+ file?: string;
4
+ sourceRoot?: string;
5
+ }
5
6
 
6
- export interface RawSourceMap extends StartOfSourceMap {
7
- version: string;
8
- sources: string[];
9
- names: string[];
10
- sourcesContent?: string[];
11
- mappings: string;
12
- }
7
+ export interface RawSourceMap extends StartOfSourceMap {
8
+ version: string;
9
+ sources: string[];
10
+ names: string[];
11
+ sourcesContent?: string[];
12
+ mappings: string;
13
+ }
13
14
 
14
- export interface Position {
15
- line: number;
16
- column: number;
17
- }
15
+ export interface Position {
16
+ line: number;
17
+ column: number;
18
+ }
18
19
 
19
- export interface LineRange extends Position {
20
- lastColumn: number;
21
- }
20
+ export interface LineRange extends Position {
21
+ lastColumn: number;
22
+ }
22
23
 
23
- export interface FindPosition extends Position {
24
- // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
25
- bias?: number;
26
- }
24
+ export interface FindPosition extends Position {
25
+ // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
26
+ bias?: number;
27
+ }
27
28
 
28
- export interface SourceFindPosition extends FindPosition {
29
- source: string;
30
- }
29
+ export interface SourceFindPosition extends FindPosition {
30
+ source: string;
31
+ }
31
32
 
32
- export interface MappedPosition extends Position {
33
- source: string;
34
- name?: string;
35
- }
33
+ export interface MappedPosition extends Position {
34
+ source: string;
35
+ name?: string;
36
+ }
36
37
 
37
- export interface MappingItem {
38
- source: string;
39
- generatedLine: number;
40
- generatedColumn: number;
41
- originalLine: number;
42
- originalColumn: number;
43
- name: string;
44
- }
38
+ export interface MappingItem {
39
+ source: string;
40
+ generatedLine: number;
41
+ generatedColumn: number;
42
+ originalLine: number;
43
+ originalColumn: number;
44
+ name: string;
45
+ }
45
46
 
46
- export class SourceMapConsumer {
47
- static GENERATED_ORDER: number;
48
- static ORIGINAL_ORDER: number;
49
-
50
- static GREATEST_LOWER_BOUND: number;
51
- static LEAST_UPPER_BOUND: number;
52
-
53
- constructor(rawSourceMap: RawSourceMap);
54
- computeColumnSpans(): void;
55
- originalPositionFor(generatedPosition: FindPosition): MappedPosition;
56
- generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
57
- allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
58
- hasContentsOfAllSources(): boolean;
59
- sourceContentFor(source: string, returnNullOnMissing?: boolean): string;
60
- eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
61
- }
47
+ export class SourceMapConsumer {
48
+ static GENERATED_ORDER: number;
49
+ static ORIGINAL_ORDER: number;
50
+
51
+ static GREATEST_LOWER_BOUND: number;
52
+ static LEAST_UPPER_BOUND: number;
53
+
54
+ constructor(rawSourceMap: RawSourceMap);
55
+ computeColumnSpans(): void;
56
+ originalPositionFor(generatedPosition: FindPosition): MappedPosition;
57
+ generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
58
+ allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
59
+ hasContentsOfAllSources(): boolean;
60
+ sourceContentFor(source: string, returnNullOnMissing?: boolean): string;
61
+ eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
62
+ }
63
+
64
+ export interface Mapping {
65
+ generated: Position;
66
+ original: Position;
67
+ source: string;
68
+ name?: string;
69
+ }
70
+
71
+ export class SourceMapGenerator {
72
+ constructor(startOfSourceMap?: StartOfSourceMap);
73
+ static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
74
+ addMapping(mapping: Mapping): void;
75
+ setSourceContent(sourceFile: string, sourceContent: string): void;
76
+ applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
77
+ toString(): string;
78
+ }
79
+
80
+ export interface CodeWithSourceMap {
81
+ code: string;
82
+ map: SourceMapGenerator;
83
+ }
62
84
 
63
- export interface Mapping {
64
- generated: Position;
65
- original: Position;
66
- source: string;
67
- name?: string;
85
+ export class SourceNode {
86
+ constructor();
87
+ constructor(line: number, column: number, source: string);
88
+ constructor(line: number, column: number, source: string, chunk?: string, name?: string);
89
+ static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
90
+ add(chunk: string): void;
91
+ prepend(chunk: string): void;
92
+ setSourceContent(sourceFile: string, sourceContent: string): void;
93
+ walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
94
+ walkSourceContents(fn: (file: string, content: string) => void): void;
95
+ join(sep: string): SourceNode;
96
+ replaceRight(pattern: string, replacement: string): SourceNode;
97
+ toString(): string;
98
+ toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
99
+ }
68
100
  }
69
101
 
70
- export class SourceMapGenerator {
71
- constructor(startOfSourceMap?: StartOfSourceMap);
72
- static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
73
- addMapping(mapping: Mapping): void;
74
- setSourceContent(sourceFile: string, sourceContent: string): void;
75
- applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
76
- toString(): string;
102
+ declare module 'source-map-js/lib/source-map-generator' {
103
+ import { SourceMapGenerator } from '../source-map-js'
104
+ export { SourceMapGenerator }
77
105
  }
78
106
 
79
- export interface CodeWithSourceMap {
80
- code: string;
81
- map: SourceMapGenerator;
107
+ declare module 'source-map-js/lib/source-map-consumer' {
108
+ import { SourceMapConsumer } from '../source-map-js'
109
+ export { SourceMapConsumer }
82
110
  }
83
111
 
84
- export class SourceNode {
85
- constructor();
86
- constructor(line: number, column: number, source: string);
87
- constructor(line: number, column: number, source: string, chunk?: string, name?: string);
88
- static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
89
- add(chunk: string): void;
90
- prepend(chunk: string): void;
91
- setSourceContent(sourceFile: string, sourceContent: string): void;
92
- walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
93
- walkSourceContents(fn: (file: string, content: string) => void): void;
94
- join(sep: string): SourceNode;
95
- replaceRight(pattern: string, replacement: string): SourceNode;
96
- toString(): string;
97
- toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
112
+ declare module 'source-map-js/lib/source-node' {
113
+ import { SourceNode } from '../source-map-js'
114
+ export { SourceNode }
98
115
  }