@umijs/bundler-webpack 4.0.0-rc.2 → 4.0.0-rc.22

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 (113) hide show
  1. package/client/client/client.js +65 -37
  2. package/client/constants.js +9 -0
  3. package/compiled/autoprefixer/browserslist/index.d.ts +2 -0
  4. package/compiled/autoprefixer/index.js +3 -3
  5. package/compiled/autoprefixer/postcss/lib/declaration.d.ts +1 -1
  6. package/compiled/autoprefixer/postcss/lib/node.d.ts +2 -2
  7. package/compiled/babel-loader/index.js +2 -2
  8. package/compiled/copy-webpack-plugin/{576.index.js → 939.index.js} +11 -11
  9. package/compiled/copy-webpack-plugin/index.js +12 -12
  10. package/compiled/css-minimizer-webpack-plugin/index.js +7 -7
  11. package/compiled/cssnano/index.js +6 -6
  12. package/compiled/cssnano/package.json +1 -1
  13. package/compiled/express.d.ts +2 -0
  14. package/compiled/fork-ts-checker-webpack-plugin/index.js +7 -13
  15. package/compiled/http-proxy-middleware/index.js +10 -10
  16. package/compiled/mini-css-extract-plugin/index.js +440 -401
  17. package/compiled/mini-css-extract-plugin/loader.js +3 -1
  18. package/compiled/mini-css-extract-plugin/utils.js +2 -0
  19. package/compiled/{tapable → react-refresh}/LICENSE +6 -6
  20. package/compiled/react-refresh/index.js +9 -7
  21. package/compiled/react-refresh/package.json +1 -0
  22. package/compiled/terser/index.js +1 -1
  23. package/compiled/webpack/BasicEffectRulePlugin.js +1 -0
  24. package/compiled/webpack/BasicMatcherRulePlugin.js +1 -0
  25. package/compiled/webpack/HotModuleReplacement.runtime.js +29 -14
  26. package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +4 -3
  27. package/compiled/webpack/ObjectMatcherRulePlugin.js +1 -0
  28. package/compiled/webpack/RuleSetCompiler.js +1 -0
  29. package/compiled/webpack/UseEffectRulePlugin.js +1 -0
  30. package/compiled/webpack/deepImports.json +6 -1
  31. package/compiled/webpack/index.js +5155 -3422
  32. package/compiled/webpack/types.d.ts +606 -171
  33. package/compiled/webpack-dev-middleware/index.js +8 -7
  34. package/compiled/webpack-manifest-plugin/index.js +1 -1
  35. package/dist/build.d.ts +1 -0
  36. package/dist/build.js +48 -57
  37. package/dist/cli.js +6 -15
  38. package/dist/client/client.js +57 -51
  39. package/dist/config/_sampleFeature.js +6 -17
  40. package/dist/config/assetRules.js +44 -55
  41. package/dist/config/bundleAnalyzerPlugin.js +12 -23
  42. package/dist/config/compressPlugin.js +89 -64
  43. package/dist/config/config.d.ts +2 -0
  44. package/dist/config/config.js +178 -179
  45. package/dist/config/copyPlugin.js +29 -40
  46. package/dist/config/cssRules.js +93 -83
  47. package/dist/config/definePlugin.js +11 -19
  48. package/dist/config/detectDeadCode.js +1 -1
  49. package/dist/config/detectDeadCodePlugin.js +21 -22
  50. package/dist/config/fastRefreshPlugin.js +11 -22
  51. package/dist/config/forkTSCheckerPlugin.js +11 -22
  52. package/dist/config/harmonyLinkingErrorPlugin.js +3 -14
  53. package/dist/config/ignorePlugin.js +10 -21
  54. package/dist/config/javaScriptRules.d.ts +1 -0
  55. package/dist/config/javaScriptRules.js +152 -138
  56. package/dist/config/manifestPlugin.js +10 -18
  57. package/dist/config/miniCSSExtractPlugin.js +12 -23
  58. package/dist/config/nodePolyfill.js +14 -20
  59. package/dist/config/nodePrefixPlugin.d.ts +11 -0
  60. package/dist/config/nodePrefixPlugin.js +14 -0
  61. package/dist/config/progressPlugin.js +7 -18
  62. package/dist/config/purgecssWebpackPlugin.js +15 -26
  63. package/dist/config/speedMeasureWebpackPlugin.js +12 -23
  64. package/dist/config/svgRules.js +44 -47
  65. package/dist/constants.d.ts +1 -0
  66. package/dist/constants.js +7 -1
  67. package/dist/dev.d.ts +4 -0
  68. package/dist/dev.js +115 -94
  69. package/dist/index.d.ts +4 -1
  70. package/dist/index.js +5 -1
  71. package/dist/loader/svgr.js +4 -13
  72. package/dist/loader/swc.js +9 -14
  73. package/dist/plugins/ProgressPlugin.js +2 -2
  74. package/dist/plugins/RuntimePublicPathPlugin.js +4 -1
  75. package/dist/schema.js +29 -13
  76. package/dist/server/server.d.ts +3 -1
  77. package/dist/server/server.js +166 -148
  78. package/dist/server/ws.d.ts +7 -2
  79. package/dist/swcPlugins/autoCSSModules.js +3 -1
  80. package/dist/swcPlugins/changeImportFromString.d.ts +2 -0
  81. package/dist/swcPlugins/changeImportFromString.js +10 -0
  82. package/dist/swcPlugins/lockCoreJS.d.ts +1 -1
  83. package/dist/swcPlugins/lockCoreJS.js +3 -2
  84. package/dist/types.d.ts +4 -0
  85. package/dist/types.js +1 -0
  86. package/dist/utils/getEsBuildTarget.d.ts +5 -0
  87. package/dist/utils/getEsBuildTarget.js +12 -0
  88. package/package.json +33 -35
  89. package/compiled/css-loader/LICENSE +0 -20
  90. package/compiled/css-loader/api.js +0 -102
  91. package/compiled/css-loader/getUrl.js +0 -29
  92. package/compiled/css-loader/index.js +0 -2
  93. package/compiled/css-loader/noSourceMaps.js +0 -5
  94. package/compiled/css-loader/package.json +0 -1
  95. package/compiled/css-loader/sourceMaps.js +0 -22
  96. package/compiled/express/LICENSE +0 -24
  97. package/compiled/express/body-parser/index.d.ts +0 -104
  98. package/compiled/express/connect/index.d.ts +0 -93
  99. package/compiled/express/express-serve-static-core/index.d.ts +0 -1252
  100. package/compiled/express/index.d.ts +0 -133
  101. package/compiled/express/index.js +0 -321
  102. package/compiled/express/mime/index.d.ts +0 -35
  103. package/compiled/express/package.json +0 -1
  104. package/compiled/express/qs/index.d.ts +0 -62
  105. package/compiled/express/range-parser/index.d.ts +0 -35
  106. package/compiled/express/serve-static/index.d.ts +0 -108
  107. package/compiled/less/index.js +0 -31
  108. package/compiled/less/package.json +0 -1
  109. package/compiled/tapable/index.js +0 -1
  110. package/compiled/tapable/package.json +0 -1
  111. package/compiled/tapable/tapable.d.ts +0 -116
  112. package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts +0 -11
  113. package/dist/plugins/ESBuildCSSMinifyPlugin.js +0 -65
@@ -1,104 +0,0 @@
1
- // Type definitions for body-parser 1.19
2
- // Project: https://github.com/expressjs/body-parser
3
- // Definitions by: Santi Albo <https://github.com/santialbo>
4
- // Vilic Vane <https://github.com/vilic>
5
- // Jonathan Häberle <https://github.com/dreampulse>
6
- // Gevik Babakhani <https://github.com/blendsdk>
7
- // Tomasz Łaziuk <https://github.com/tlaziuk>
8
- // Jason Walton <https://github.com/jwalton>
9
- // Piotr Błażejewicz <https://github.com/peterblazejewicz>
10
- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
11
-
12
- /// <reference types="node" />
13
-
14
- import { NextHandleFunction } from '../connect';
15
- import * as http from 'http';
16
-
17
- // for docs go to https://github.com/expressjs/body-parser/tree/1.19.0#body-parser
18
-
19
- /** @deprecated */
20
- declare function bodyParser(
21
- options?: bodyParser.OptionsJson & bodyParser.OptionsText & bodyParser.OptionsUrlencoded,
22
- ): NextHandleFunction;
23
-
24
- declare namespace bodyParser {
25
- interface Options {
26
- /** When set to true, then deflated (compressed) bodies will be inflated; when false, deflated bodies are rejected. Defaults to true. */
27
- inflate?: boolean | undefined;
28
- /**
29
- * Controls the maximum request body size. If this is a number,
30
- * then the value specifies the number of bytes; if it is a string,
31
- * the value is passed to the bytes library for parsing. Defaults to '100kb'.
32
- */
33
- limit?: number | string | undefined;
34
- /**
35
- * The type option is used to determine what media type the middleware will parse
36
- */
37
- type?: string | string[] | ((req: http.IncomingMessage) => any) | undefined;
38
- /**
39
- * The verify option, if supplied, is called as verify(req, res, buf, encoding),
40
- * where buf is a Buffer of the raw request body and encoding is the encoding of the request.
41
- */
42
- verify?(req: http.IncomingMessage, res: http.ServerResponse, buf: Buffer, encoding: string): void;
43
- }
44
-
45
- interface OptionsJson extends Options {
46
- /**
47
- *
48
- * The reviver option is passed directly to JSON.parse as the second argument.
49
- */
50
- reviver?(key: string, value: any): any;
51
- /**
52
- * When set to `true`, will only accept arrays and objects;
53
- * when `false` will accept anything JSON.parse accepts. Defaults to `true`.
54
- */
55
- strict?: boolean | undefined;
56
- }
57
-
58
- interface OptionsText extends Options {
59
- /**
60
- * Specify the default character set for the text content if the charset
61
- * is not specified in the Content-Type header of the request.
62
- * Defaults to `utf-8`.
63
- */
64
- defaultCharset?: string | undefined;
65
- }
66
-
67
- interface OptionsUrlencoded extends Options {
68
- /**
69
- * The extended option allows to choose between parsing the URL-encoded data
70
- * with the querystring library (when `false`) or the qs library (when `true`).
71
- */
72
- extended?: boolean | undefined;
73
- /**
74
- * The parameterLimit option controls the maximum number of parameters
75
- * that are allowed in the URL-encoded data. If a request contains more parameters than this value,
76
- * a 413 will be returned to the client. Defaults to 1000.
77
- */
78
- parameterLimit?: number | undefined;
79
- }
80
-
81
- /**
82
- * Returns middleware that only parses json and only looks at requests
83
- * where the Content-Type header matches the type option.
84
- */
85
- function json(options?: OptionsJson): NextHandleFunction;
86
- /**
87
- * Returns middleware that parses all bodies as a Buffer and only looks at requests
88
- * where the Content-Type header matches the type option.
89
- */
90
- function raw(options?: Options): NextHandleFunction;
91
-
92
- /**
93
- * Returns middleware that parses all bodies as a string and only looks at requests
94
- * where the Content-Type header matches the type option.
95
- */
96
- function text(options?: OptionsText): NextHandleFunction;
97
- /**
98
- * Returns middleware that only parses urlencoded bodies and only looks at requests
99
- * where the Content-Type header matches the type option
100
- */
101
- function urlencoded(options?: OptionsUrlencoded): NextHandleFunction;
102
- }
103
-
104
- export = bodyParser;
@@ -1,93 +0,0 @@
1
- // Type definitions for connect v3.4.0
2
- // Project: https://github.com/senchalabs/connect
3
- // Definitions by: Maxime LUCE <https://github.com/SomaticIT>
4
- // Evan Hahn <https://github.com/EvanHahn>
5
- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
-
7
- /// <reference types="node" />
8
-
9
-
10
- import * as http from 'http';
11
-
12
- /**
13
- * Create a new connect server.
14
- */
15
- declare function createServer(): createServer.Server;
16
-
17
- declare namespace createServer {
18
- export type ServerHandle = HandleFunction | http.Server;
19
-
20
- export class IncomingMessage extends http.IncomingMessage {
21
- originalUrl?: http.IncomingMessage["url"] | undefined;
22
- }
23
-
24
- type NextFunction = (err?: any) => void;
25
-
26
- export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void;
27
- export type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
28
- export type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
29
- export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction;
30
-
31
- export interface ServerStackItem {
32
- route: string;
33
- handle: ServerHandle;
34
- }
35
-
36
- export interface Server extends NodeJS.EventEmitter {
37
- (req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
38
-
39
- route: string;
40
- stack: ServerStackItem[];
41
-
42
- /**
43
- * Utilize the given middleware `handle` to the given `route`,
44
- * defaulting to _/_. This "route" is the mount-point for the
45
- * middleware, when given a value other than _/_ the middleware
46
- * is only effective when that segment is present in the request's
47
- * pathname.
48
- *
49
- * For example if we were to mount a function at _/admin_, it would
50
- * be invoked on _/admin_, and _/admin/settings_, however it would
51
- * not be invoked for _/_, or _/posts_.
52
- */
53
- use(fn: NextHandleFunction): Server;
54
- use(fn: HandleFunction): Server;
55
- use(route: string, fn: NextHandleFunction): Server;
56
- use(route: string, fn: HandleFunction): Server;
57
-
58
- /**
59
- * Handle server requests, punting them down
60
- * the middleware stack.
61
- */
62
- handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void;
63
-
64
- /**
65
- * Listen for connections.
66
- *
67
- * This method takes the same arguments
68
- * as node's `http.Server#listen()`.
69
- *
70
- * HTTP and HTTPS:
71
- *
72
- * If you run your application both as HTTP
73
- * and HTTPS you may wrap them individually,
74
- * since your Connect "server" is really just
75
- * a JavaScript `Function`.
76
- *
77
- * var connect = require('connect')
78
- * , http = require('http')
79
- * , https = require('https');
80
- *
81
- * var app = connect();
82
- *
83
- * http.createServer(app).listen(80);
84
- * https.createServer(options, app).listen(443);
85
- */
86
- listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server;
87
- listen(port: number, hostname?: string, callback?: Function): http.Server;
88
- listen(path: string, callback?: Function): http.Server;
89
- listen(handle: any, listeningListener?: Function): http.Server;
90
- }
91
- }
92
-
93
- export = createServer;