@umijs/bundler-webpack 4.0.0-beta.8 → 4.0.0-canary.20220317.1

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 (198) hide show
  1. package/compiled/autoprefixer/browserslist/index.d.ts +11 -7
  2. package/compiled/autoprefixer/index.js +3 -3
  3. package/compiled/autoprefixer/postcss/lib/at-rule.d.ts +1 -1
  4. package/compiled/autoprefixer/postcss/lib/comment.d.ts +1 -1
  5. package/compiled/autoprefixer/postcss/lib/container.d.ts +2 -2
  6. package/compiled/autoprefixer/postcss/lib/css-syntax-error.d.ts +55 -8
  7. package/compiled/autoprefixer/postcss/lib/declaration.d.ts +1 -1
  8. package/compiled/autoprefixer/postcss/lib/input.d.ts +26 -6
  9. package/compiled/autoprefixer/postcss/lib/lazy-result.d.ts +11 -10
  10. package/compiled/autoprefixer/postcss/lib/no-work-result.d.ts +37 -0
  11. package/compiled/autoprefixer/postcss/lib/node.d.ts +36 -2
  12. package/compiled/autoprefixer/postcss/lib/postcss.d.ts +31 -30
  13. package/compiled/autoprefixer/postcss/lib/processor.d.ts +5 -4
  14. package/compiled/autoprefixer/postcss/lib/result.d.ts +3 -2
  15. package/compiled/autoprefixer/postcss/lib/rule.d.ts +1 -1
  16. package/compiled/autoprefixer/postcss/lib/warning.d.ts +37 -3
  17. package/compiled/autoprefixer/source-map-js/source-map.d.ts +99 -82
  18. package/compiled/babel-loader/index.js +2 -2
  19. package/compiled/copy-webpack-plugin/576.index.js +1171 -0
  20. package/compiled/copy-webpack-plugin/index.js +16 -10
  21. package/compiled/copy-webpack-plugin/package.json +1 -1
  22. package/compiled/css-minimizer-webpack-plugin/index.js +8 -2
  23. package/compiled/css-minimizer-webpack-plugin/minify.js +25 -11
  24. package/compiled/css-minimizer-webpack-plugin/package.json +1 -1
  25. package/compiled/css-minimizer-webpack-plugin/utils.js +225 -28
  26. package/compiled/cssnano/index.js +12 -11
  27. package/compiled/cssnano/package.json +1 -1
  28. package/compiled/express.d.ts +2 -0
  29. package/compiled/fork-ts-checker-webpack-plugin/LICENSE +21 -0
  30. package/compiled/fork-ts-checker-webpack-plugin/fsevents.node +0 -0
  31. package/compiled/fork-ts-checker-webpack-plugin/index.js +48 -0
  32. package/compiled/fork-ts-checker-webpack-plugin/package.json +1 -0
  33. package/compiled/http-proxy-middleware/dist/types.d.ts +5 -5
  34. package/compiled/http-proxy-middleware/http-proxy/index.d.ts +1 -1
  35. package/compiled/http-proxy-middleware/index.js +10 -10
  36. package/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +60 -8
  37. package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +13 -1
  38. package/compiled/mini-css-extract-plugin/index.js +7970 -7445
  39. package/compiled/mini-css-extract-plugin/loader.js +179 -54
  40. package/compiled/mini-css-extract-plugin/package.json +1 -1
  41. package/compiled/mini-css-extract-plugin/utils.js +85 -24
  42. package/compiled/postcss-loader/index.js +1 -1
  43. package/compiled/react-refresh/index.js +3 -3
  44. package/compiled/sass-loader/index.js +1 -1
  45. package/compiled/schema-utils/ajv/dist/ajv.d.ts +16 -0
  46. package/compiled/schema-utils/ajv/dist/compile/codegen/code.d.ts +39 -0
  47. package/compiled/schema-utils/ajv/dist/compile/codegen/index.d.ts +79 -0
  48. package/compiled/schema-utils/ajv/dist/compile/codegen/scope.d.ts +79 -0
  49. package/compiled/schema-utils/ajv/dist/compile/errors.d.ts +13 -0
  50. package/compiled/schema-utils/ajv/dist/compile/index.d.ts +80 -0
  51. package/compiled/schema-utils/ajv/dist/compile/ref_error.d.ts +5 -0
  52. package/compiled/schema-utils/ajv/dist/compile/resolve.d.ts +12 -0
  53. package/compiled/schema-utils/ajv/dist/compile/rules.d.ts +28 -0
  54. package/compiled/schema-utils/ajv/dist/compile/util.d.ts +40 -0
  55. package/compiled/schema-utils/ajv/dist/compile/validate/index.d.ts +42 -0
  56. package/compiled/schema-utils/ajv/dist/compile/validate/subschema.d.ts +47 -0
  57. package/compiled/schema-utils/ajv/dist/core.d.ts +171 -0
  58. package/compiled/schema-utils/ajv/dist/runtime/validation_error.d.ts +7 -0
  59. package/compiled/schema-utils/ajv/dist/types/index.d.ts +177 -0
  60. package/compiled/schema-utils/ajv/dist/types/json-schema.d.ts +124 -0
  61. package/compiled/schema-utils/ajv/dist/types/jtd-schema.d.ts +168 -0
  62. package/compiled/schema-utils/declarations/validate.d.ts +4 -4
  63. package/compiled/schema-utils/index.js +8 -2
  64. package/compiled/schema-utils/uri-js/dist/es5/uri.all.d.ts +59 -0
  65. package/compiled/style-loader/index.js +1 -1
  66. package/compiled/terser/index.js +1 -1
  67. package/compiled/terser-webpack-plugin/index.js +393 -517
  68. package/compiled/terser-webpack-plugin/jest-worker/build/types.d.ts +1 -0
  69. package/compiled/terser-webpack-plugin/minify.js +10 -3
  70. package/compiled/terser-webpack-plugin/package.json +1 -1
  71. package/compiled/terser-webpack-plugin/types/index.d.ts +183 -149
  72. package/compiled/terser-webpack-plugin/types/minify.d.ts +17 -0
  73. package/compiled/terser-webpack-plugin/types/utils.d.ts +10 -15
  74. package/compiled/terser-webpack-plugin/utils.js +118 -25
  75. package/compiled/webpack/index.js +11665 -5565
  76. package/compiled/webpack-dev-middleware/index.js +11 -5
  77. package/compiled/webpack-dev-middleware/package.json +1 -1
  78. package/compiled/webpack-manifest-plugin/LICENSE +21 -0
  79. package/compiled/webpack-manifest-plugin/index.js +1 -0
  80. package/compiled/webpack-manifest-plugin/package.json +1 -0
  81. package/compiled/webpack-sources/index.js +1 -1
  82. package/compiled/ws/index.d.ts +1 -2
  83. package/compiled/ws/index.js +1 -1
  84. package/dist/build.d.ts +5 -3
  85. package/dist/build.js +2 -1
  86. package/dist/cli.d.ts +0 -1
  87. package/dist/cli.js +4 -7
  88. package/dist/client/client.js +5 -1
  89. package/dist/config/assetRules.js +6 -2
  90. package/dist/config/compressPlugin.js +6 -0
  91. package/dist/config/config.d.ts +7 -2
  92. package/dist/config/config.js +50 -8
  93. package/dist/config/cssRules.js +2 -2
  94. package/dist/config/detectDeadCode.d.ts +12 -0
  95. package/dist/config/detectDeadCode.js +120 -0
  96. package/dist/config/detectDeadCodePlugin.d.ts +9 -0
  97. package/dist/config/detectDeadCodePlugin.js +75 -0
  98. package/dist/config/forkTSCheckerPlugin.d.ts +11 -0
  99. package/dist/config/forkTSCheckerPlugin.js +34 -0
  100. package/dist/config/harmonyLinkingErrorPlugin.d.ts +6 -0
  101. package/dist/config/harmonyLinkingErrorPlugin.js +42 -0
  102. package/dist/config/javaScriptRules.d.ts +1 -0
  103. package/dist/config/javaScriptRules.js +33 -25
  104. package/dist/config/manifestPlugin.d.ts +11 -0
  105. package/dist/config/manifestPlugin.js +25 -0
  106. package/dist/config/miniCSSExtractPlugin.d.ts +1 -0
  107. package/dist/config/miniCSSExtractPlugin.js +2 -3
  108. package/dist/config/svgRules.d.ts +1 -0
  109. package/dist/config/svgRules.js +12 -11
  110. package/dist/constants.d.ts +3 -0
  111. package/dist/constants.js +4 -1
  112. package/dist/dev.d.ts +4 -3
  113. package/dist/dev.js +31 -5
  114. package/dist/index.d.ts +4 -2
  115. package/dist/index.js +5 -1
  116. package/dist/loader/svgr.d.ts +4 -0
  117. package/dist/loader/svgr.js +67 -0
  118. package/dist/loader/swc.d.ts +4 -0
  119. package/dist/loader/swc.js +79 -0
  120. package/dist/plugins/ESBuildCSSMinifyPlugin.js +1 -3
  121. package/dist/plugins/ParcelCSSMinifyPlugin.d.ts +10 -0
  122. package/dist/plugins/ParcelCSSMinifyPlugin.js +75 -0
  123. package/dist/plugins/ProgressPlugin.js +2 -2
  124. package/dist/plugins/RuntimePublicPathPlugin.d.ts +4 -0
  125. package/dist/plugins/RuntimePublicPathPlugin.js +20 -0
  126. package/dist/requireHook.js +1 -1
  127. package/dist/schema.js +17 -9
  128. package/dist/server/server.js +25 -3
  129. package/dist/swcPlugins/autoCSSModules.d.ts +7 -2
  130. package/dist/swcPlugins/autoCSSModules.js +13 -16
  131. package/dist/swcPlugins/lockCoreJS.d.ts +6 -0
  132. package/dist/swcPlugins/lockCoreJS.js +23 -0
  133. package/dist/types.d.ts +16 -0
  134. package/dist/types.js +1 -0
  135. package/dist/utils/depMatch.js +1 -1
  136. package/package.json +64 -63
  137. package/compiled/@svgr/webpack/.svgo.yml +0 -75
  138. package/compiled/@svgr/webpack/LICENSE +0 -7
  139. package/compiled/@svgr/webpack/index.js +0 -343
  140. package/compiled/@svgr/webpack/package.json +0 -1
  141. package/compiled/css-loader/LICENSE +0 -20
  142. package/compiled/css-loader/api.js +0 -102
  143. package/compiled/css-loader/getUrl.js +0 -29
  144. package/compiled/css-loader/index.js +0 -2
  145. package/compiled/css-loader/noSourceMaps.js +0 -5
  146. package/compiled/css-loader/package.json +0 -1
  147. package/compiled/css-loader/sourceMaps.js +0 -22
  148. package/compiled/express/LICENSE +0 -24
  149. package/compiled/express/body-parser/index.d.ts +0 -104
  150. package/compiled/express/connect/index.d.ts +0 -93
  151. package/compiled/express/express-serve-static-core/index.d.ts +0 -1252
  152. package/compiled/express/index.d.ts +0 -133
  153. package/compiled/express/index.js +0 -338
  154. package/compiled/express/mime/index.d.ts +0 -35
  155. package/compiled/express/package.json +0 -1
  156. package/compiled/express/qs/index.d.ts +0 -62
  157. package/compiled/express/range-parser/index.d.ts +0 -35
  158. package/compiled/express/serve-static/index.d.ts +0 -108
  159. package/compiled/less/index.js +0 -31
  160. package/compiled/less/package.json +0 -1
  161. package/compiled/swc-loader/LICENSE +0 -25
  162. package/compiled/swc-loader/index.js +0 -1
  163. package/compiled/swc-loader/package.json +0 -1
  164. package/dist/build.d.ts.map +0 -1
  165. package/dist/cli.d.ts.map +0 -1
  166. package/dist/client/client.d.ts.map +0 -1
  167. package/dist/config/_sampleFeature.d.ts.map +0 -1
  168. package/dist/config/assetRules.d.ts.map +0 -1
  169. package/dist/config/bundleAnalyzerPlugin.d.ts.map +0 -1
  170. package/dist/config/compressPlugin.d.ts.map +0 -1
  171. package/dist/config/config.d.ts.map +0 -1
  172. package/dist/config/copyPlugin.d.ts.map +0 -1
  173. package/dist/config/cssRules.d.ts.map +0 -1
  174. package/dist/config/definePlugin.d.ts.map +0 -1
  175. package/dist/config/fastRefreshPlugin.d.ts.map +0 -1
  176. package/dist/config/ignorePlugin.d.ts.map +0 -1
  177. package/dist/config/javaScriptRules.d.ts.map +0 -1
  178. package/dist/config/miniCSSExtractPlugin.d.ts.map +0 -1
  179. package/dist/config/nodePolyfill.d.ts.map +0 -1
  180. package/dist/config/progressPlugin.d.ts.map +0 -1
  181. package/dist/config/purgecssWebpackPlugin.d.ts.map +0 -1
  182. package/dist/config/speedMeasureWebpackPlugin.d.ts.map +0 -1
  183. package/dist/config/svgRules.d.ts.map +0 -1
  184. package/dist/constants.d.ts.map +0 -1
  185. package/dist/dev.d.ts.map +0 -1
  186. package/dist/index.d.ts.map +0 -1
  187. package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts.map +0 -1
  188. package/dist/plugins/ProgressPlugin.d.ts.map +0 -1
  189. package/dist/plugins/_SamplePlugin.d.ts.map +0 -1
  190. package/dist/requireHook.d.ts.map +0 -1
  191. package/dist/schema.d.ts.map +0 -1
  192. package/dist/server/server.d.ts.map +0 -1
  193. package/dist/server/ws.d.ts.map +0 -1
  194. package/dist/swcPlugins/autoCSSModules.d.ts.map +0 -1
  195. package/dist/types.d.ts.map +0 -1
  196. package/dist/utils/browsersList.d.ts.map +0 -1
  197. package/dist/utils/depMatch.d.ts.map +0 -1
  198. package/dist/utils/formatWebpackMessages.d.ts.map +0 -1
@@ -1,8 +1,13 @@
1
- import { ImportDeclaration, TsType, VariableDeclaration } from '@swc/core';
1
+ import type { ImportDeclaration, ModuleItem, TsType } from '@swc/core';
2
2
  import Visitor from '@swc/core/Visitor';
3
3
  declare class AutoCSSModule extends Visitor {
4
4
  visitTsType(expression: TsType): TsType;
5
+ /**
6
+ * call path:
7
+ * visitProgram -> visitModule -> visitModuleItems -> visitModuleItem -> visitImportDeclaration
8
+ * @see https://github.com/swc-project/swc/blob/main/node-swc/src/Visitor.ts#L189
9
+ */
10
+ visitModuleItem(n: ModuleItem): ImportDeclaration | import("@swc/core").ExportDeclaration | import("@swc/core").ExportNamedDeclaration | import("@swc/core").ExportDefaultDeclaration | import("@swc/core").ExportDefaultExpression | import("@swc/core").ExportAllDeclaration | import("@swc/core").TsImportEqualsDeclaration | import("@swc/core").TsExportAssignment | import("@swc/core").TsNamespaceExportDeclaration | import("@swc/core").ExpressionStatement | import("@swc/core").BlockStatement | import("@swc/core").EmptyStatement | import("@swc/core").DebuggerStatement | import("@swc/core").WithStatement | import("@swc/core").ReturnStatement | import("@swc/core").LabeledStatement | import("@swc/core").BreakStatement | import("@swc/core").ContinueStatement | import("@swc/core").IfStatement | import("@swc/core").SwitchStatement | import("@swc/core").ThrowStatement | import("@swc/core").TryStatement | import("@swc/core").WhileStatement | import("@swc/core").DoWhileStatement | import("@swc/core").ForStatement | import("@swc/core").ForInStatement | import("@swc/core").ForOfStatement | import("@swc/core").ClassDeclaration | import("@swc/core").FunctionDeclaration | import("@swc/core").VariableDeclaration | import("@swc/core").TsInterfaceDeclaration | import("@swc/core").TsTypeAliasDeclaration | import("@swc/core").TsEnumDeclaration | import("@swc/core").TsModuleDeclaration;
5
11
  visitImportDeclaration(expression: ImportDeclaration): ImportDeclaration;
6
- visitVariableDeclaration(expression: VariableDeclaration): VariableDeclaration;
7
12
  }
8
13
  export default AutoCSSModule;
@@ -4,32 +4,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const Visitor_1 = __importDefault(require("@swc/core/Visitor"));
7
- const path_1 = require("path");
8
- const CSS_EXT_NAMES = ['.css', '.less', '.sass', '.scss', '.stylus', '.styl'];
7
+ const utils_1 = require("@umijs/utils");
9
8
  class AutoCSSModule extends Visitor_1.default {
10
9
  visitTsType(expression) {
11
10
  return expression;
12
11
  }
12
+ /**
13
+ * call path:
14
+ * visitProgram -> visitModule -> visitModuleItems -> visitModuleItem -> visitImportDeclaration
15
+ * @see https://github.com/swc-project/swc/blob/main/node-swc/src/Visitor.ts#L189
16
+ */
17
+ visitModuleItem(n) {
18
+ if (n.type === 'ImportDeclaration') {
19
+ return this.visitImportDeclaration(n);
20
+ }
21
+ return n;
22
+ }
13
23
  visitImportDeclaration(expression) {
14
24
  const { specifiers, source } = expression;
15
25
  const { value } = source;
16
- if (specifiers.length && CSS_EXT_NAMES.includes((0, path_1.extname)(value))) {
26
+ if (specifiers.length && (0, utils_1.isStyleFile)({ filename: value })) {
17
27
  return Object.assign(Object.assign({}, expression), { source: Object.assign(Object.assign({}, source), { value: `${value}?modules` }) });
18
28
  }
19
29
  return expression;
20
30
  }
21
- visitVariableDeclaration(expression) {
22
- const { declarations } = expression;
23
- if (declarations.length &&
24
- declarations[0].init &&
25
- declarations[0].init.type === 'AwaitExpression' &&
26
- declarations[0].init.argument.type === 'CallExpression' &&
27
- declarations[0].init.argument.arguments[0].expression.type ===
28
- 'StringLiteral' &&
29
- CSS_EXT_NAMES.includes((0, path_1.extname)(declarations[0].init.argument.arguments[0].expression.value))) {
30
- declarations[0].init.argument.arguments[0].expression.value = `${declarations[0].init.argument.arguments[0].expression.value}?modules`;
31
- }
32
- return expression;
33
- }
34
31
  }
35
32
  exports.default = AutoCSSModule;
@@ -0,0 +1,6 @@
1
+ import type { ImportDeclaration } from '@swc/core';
2
+ import Visitor from '@swc/core/Visitor';
3
+ declare class LockCoreJS extends Visitor {
4
+ visitImportDeclaration(expression: ImportDeclaration): ImportDeclaration;
5
+ }
6
+ export default LockCoreJS;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Visitor_1 = __importDefault(require("@swc/core/Visitor"));
7
+ const utils_1 = require("@umijs/utils");
8
+ const path_1 = require("path");
9
+ function addLastSlash(path) {
10
+ return path.endsWith('/') ? path : `${path}/`;
11
+ }
12
+ class LockCoreJS extends Visitor_1.default {
13
+ visitImportDeclaration(expression) {
14
+ const { source } = expression;
15
+ let { value, type } = source;
16
+ if (type === 'StringLiteral' && value.startsWith('core-js/')) {
17
+ value = value.replace(/^core-js\//, addLastSlash((0, utils_1.winPath)((0, path_1.dirname)(require.resolve('core-js/package.json')))));
18
+ return Object.assign(Object.assign({}, expression), { source: Object.assign(Object.assign({}, source), { value }) });
19
+ }
20
+ return expression;
21
+ }
22
+ }
23
+ exports.default = LockCoreJS;
package/dist/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Config as SwcConfig } from '@swc/core';
1
2
  import type { Options as ProxyOptions } from '../compiled/http-proxy-middleware';
2
3
  import { Configuration } from '../compiled/webpack';
3
4
  import Config from '../compiled/webpack-5-chain';
@@ -21,6 +22,7 @@ export declare enum JSMinifier {
21
22
  export declare enum CSSMinifier {
22
23
  esbuild = "esbuild",
23
24
  cssnano = "cssnano",
25
+ parcelCSS = "parcelCSS",
24
26
  none = "none"
25
27
  }
26
28
  export interface ICopy {
@@ -31,9 +33,18 @@ declare type WebpackConfig = Required<Configuration>;
31
33
  declare type IBabelPlugin = Function | string | [string, {
32
34
  [key: string]: any;
33
35
  }];
36
+ export interface DeadCodeParams {
37
+ patterns?: string[];
38
+ exclude?: string[];
39
+ failOnHint?: boolean;
40
+ detectUnusedFiles?: boolean;
41
+ detectUnusedExport?: boolean;
42
+ context?: string;
43
+ }
34
44
  export interface IConfig {
35
45
  alias?: Record<string, string>;
36
46
  autoCSSModules?: boolean;
47
+ base?: string;
37
48
  chainWebpack?: Function;
38
49
  copy?: ICopy[] | string[];
39
50
  cssLoader?: {
@@ -51,6 +62,7 @@ export interface IConfig {
51
62
  };
52
63
  depTranspiler?: Transpiler;
53
64
  devtool?: Config.DevTool;
65
+ deadCode?: DeadCodeParams;
54
66
  externals?: WebpackConfig['externals'];
55
67
  esm?: {
56
68
  [key: string]: any;
@@ -97,4 +109,8 @@ export interface IConfig {
97
109
  writeToDisk?: boolean;
98
110
  [key: string]: any;
99
111
  }
112
+ export interface SwcOptions extends SwcConfig {
113
+ sync?: boolean;
114
+ parseMap?: boolean;
115
+ }
100
116
  export {};
package/dist/types.js CHANGED
@@ -25,5 +25,6 @@ var CSSMinifier;
25
25
  (function (CSSMinifier) {
26
26
  CSSMinifier["esbuild"] = "esbuild";
27
27
  CSSMinifier["cssnano"] = "cssnano";
28
+ CSSMinifier["parcelCSS"] = "parcelCSS";
28
29
  CSSMinifier["none"] = "none";
29
30
  })(CSSMinifier = exports.CSSMinifier || (exports.CSSMinifier = {}));
@@ -15,7 +15,7 @@ function isMatch(opts) {
15
15
  return !!cache.get(dir);
16
16
  }
17
17
  else {
18
- const pkgPath = utils_1.pkgUp.sync({ cwd: opts.path });
18
+ const pkgPath = utils_1.pkgUp.pkgUpSync({ cwd: opts.path });
19
19
  let ret;
20
20
  if (!pkgPath) {
21
21
  ret = false;
package/package.json CHANGED
@@ -1,9 +1,19 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "4.0.0-beta.8",
3
+ "version": "4.0.0-canary.20220317.1",
4
4
  "description": "@umijs/bundler-webpack",
5
+ "homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-webpack#readme",
6
+ "bugs": "https://github.com/umijs/umi-next/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/umijs/umi-next"
10
+ },
11
+ "license": "MIT",
5
12
  "main": "dist/index.js",
6
13
  "types": "dist/index.d.ts",
14
+ "bin": {
15
+ "bundler-webpack": "bin/bundler-webpack.js"
16
+ },
7
17
  "files": [
8
18
  "bin",
9
19
  "client",
@@ -15,80 +25,71 @@
15
25
  "build:client": "pnpm tsc --project ./tsconfig.client.json",
16
26
  "build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
17
27
  "dev": "pnpm build -- --watch",
18
- "generate:webpackPackages": "zx ./scripts/generateWebpackPackages.mjs"
19
- },
20
- "repository": {
21
- "type": "git",
22
- "url": "https://github.com/umijs/umi-next"
23
- },
24
- "authors": [
25
- "chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
26
- ],
27
- "license": "MIT",
28
- "bugs": "https://github.com/umijs/umi-next/issues",
29
- "homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-webpack#readme",
30
- "publishConfig": {
31
- "access": "public"
32
- },
33
- "bin": {
34
- "bundler-webpack": "bin/bundler-webpack.js"
28
+ "generate:webpackPackages": "zx ./scripts/generateWebpackPackages.mjs",
29
+ "test": "jest -c ../../jest.turbo.config.ts"
35
30
  },
36
31
  "dependencies": {
37
- "@pmmmwh/react-refresh-webpack-plugin": "0.5.1",
38
- "@swc/core": "1.2.105",
39
- "@types/hapi__joi": "17.1.7",
40
- "@umijs/babel-preset-umi": "4.0.0-beta.8",
41
- "@umijs/mfsu": "4.0.0-beta.8",
42
- "@umijs/utils": "4.0.0-beta.8",
43
- "css-loader": "6.5.0",
32
+ "@parcel/css": "1.6.0",
33
+ "@pmmmwh/react-refresh-webpack-plugin": "0.5.4",
34
+ "@svgr/core": "6.2.1",
35
+ "@svgr/plugin-jsx": "^6.2.1",
36
+ "@svgr/plugin-svgo": "^6.2.0",
37
+ "@types/hapi__joi": "17.1.8",
38
+ "@umijs/babel-preset-umi": "4.0.0-canary.20220317.1",
39
+ "@umijs/mfsu": "4.0.0-canary.20220317.1",
40
+ "@umijs/utils": "4.0.0-canary.20220317.1",
41
+ "css-loader": "6.7.1",
44
42
  "es5-imcompatible-versions": "^0.1.73",
45
- "jest-worker": "27.3.1",
43
+ "jest-worker": "27.5.1",
46
44
  "node-libs-browser": "2.2.1",
47
- "postcss": "^8.3.11",
48
- "postcss-preset-env": "6.7.0",
45
+ "postcss": "^8.4.8",
46
+ "postcss-preset-env": "7.4.2",
49
47
  "react-error-overlay": "6.0.9"
50
48
  },
51
49
  "devDependencies": {
52
- "@svgr/webpack": "5.5.0",
53
- "@types/express": "4.17.13",
50
+ "@swc/core": "1.2.154",
54
51
  "@types/webpack-sources": "3.2.0",
55
- "@types/ws": "8.2.0",
56
- "autoprefixer": "10.3.7",
57
- "babel-loader": "8.2.2",
52
+ "@types/ws": "8.5.3",
53
+ "autoprefixer": "10.4.2",
54
+ "babel-loader": "8.2.3",
58
55
  "compression": "1.7.4",
59
56
  "connect-history-api-fallback": "1.6.0",
60
- "copy-webpack-plugin": "9.0.1",
61
- "css-minimizer-webpack-plugin": "3.1.1",
62
- "cssnano": "5.0.8",
63
- "express": "4.17.1",
64
- "http-proxy-middleware": "2.0.1",
65
- "less": "4.1.2",
57
+ "copy-webpack-plugin": "10.2.4",
58
+ "css-minimizer-webpack-plugin": "3.4.1",
59
+ "cssnano": "5.1.3",
60
+ "fork-ts-checker-webpack-plugin": "7.2.1",
61
+ "http-proxy-middleware": "2.0.4",
66
62
  "less-loader": "10.2.0",
67
- "mini-css-extract-plugin": "2.4.2",
63
+ "mini-css-extract-plugin": "2.6.0",
68
64
  "postcss-flexbugs-fixes": "5.0.2",
69
- "postcss-loader": "6.2.0",
70
- "purgecss-webpack-plugin": "4.0.3",
71
- "react-refresh": "0.10.0",
72
- "sass-loader": "12.2.0",
73
- "schema-utils": "3.1.1",
65
+ "postcss-loader": "6.2.1",
66
+ "purgecss-webpack-plugin": "4.1.3",
67
+ "react-refresh": "0.11.0",
68
+ "sass-loader": "12.6.0",
69
+ "schema-utils": "4.0.0",
74
70
  "speed-measure-webpack-plugin": "1.5.0",
75
- "style-loader": "3.3.0",
71
+ "style-loader": "3.3.1",
76
72
  "svgo-loader": "3.0.0",
77
- "swc-loader": "0.1.15",
78
73
  "tapable": "2.2.1",
79
- "terser": "5.9.0",
80
- "terser-webpack-plugin": "5.2.4",
74
+ "terser": "5.12.0",
75
+ "terser-webpack-plugin": "5.3.1",
81
76
  "url-loader": "4.1.1",
82
- "webpack": "5.61.0",
77
+ "webpack": "5.70.0",
83
78
  "webpack-5-chain": "8.0.0",
84
79
  "webpack-bundle-analyzer": "4.5.0",
85
- "webpack-dev-middleware": "5.2.1",
86
- "webpack-sources": "3.2.1",
87
- "ws": "8.2.3"
80
+ "webpack-dev-middleware": "5.3.1",
81
+ "webpack-manifest-plugin": "5.0.0",
82
+ "webpack-sources": "3.2.3",
83
+ "ws": "8.5.0"
84
+ },
85
+ "publishConfig": {
86
+ "access": "public"
88
87
  },
88
+ "authors": [
89
+ "chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
90
+ ],
89
91
  "compiledConfig": {
90
92
  "deps": [
91
- "@svgr/webpack",
92
93
  "autoprefixer",
93
94
  "babel-loader",
94
95
  "copy-webpack-plugin",
@@ -97,9 +98,8 @@
97
98
  "cssnano",
98
99
  "compression",
99
100
  "connect-history-api-fallback",
100
- "express",
101
+ "fork-ts-checker-webpack-plugin",
101
102
  "http-proxy-middleware",
102
- "less",
103
103
  "less-loader",
104
104
  "mini-css-extract-plugin",
105
105
  "postcss-flexbugs-fixes",
@@ -108,7 +108,6 @@
108
108
  "sass-loader",
109
109
  "schema-utils",
110
110
  "style-loader",
111
- "swc-loader",
112
111
  "speed-measure-webpack-plugin",
113
112
  "svgo-loader",
114
113
  "tapable",
@@ -118,6 +117,7 @@
118
117
  "webpack-5-chain",
119
118
  "webpack-bundle-analyzer",
120
119
  "webpack-dev-middleware",
120
+ "webpack-manifest-plugin",
121
121
  "webpack-sources",
122
122
  "ws",
123
123
  "./bundles/webpack/bundle",
@@ -128,17 +128,19 @@
128
128
  "@babel/core": "@umijs/bundler-utils/compiled/babel/core",
129
129
  "es-module-lexer": "@umijs/bundler-utils/compiled/es-module-lexer",
130
130
  "esbuild": "@umijs/bundler-utils/compiled/esbuild",
131
- "express": "$$LOCAL",
131
+ "express": "@umijs/bundler-utils/compiled/express",
132
132
  "jest-worker": "jest-worker",
133
- "less": "$$LOCAL",
133
+ "less": "@umijs/bundler-utils/compiled/less",
134
134
  "cssnano": "$$LOCAL",
135
135
  "postcss": "postcss",
136
136
  "tapable": "$$LOCAL",
137
137
  "terser": "$$LOCAL",
138
138
  "terser-webpack-plugin": "$$LOCAL",
139
+ "typescript": "typescript",
139
140
  "uglify-js": "uglify-js",
140
141
  "url-loader": "$$LOCAL",
141
142
  "webpack": "$$LOCAL",
143
+ "webpack/lib/NormalModule": "../webpack/NormalModule",
142
144
  "webpack-5-chain": "$$LOCAL",
143
145
  "webpack-sources": "$$LOCAL",
144
146
  "ws": "$$LOCAL"
@@ -159,7 +161,6 @@
159
161
  "webpack"
160
162
  ],
161
163
  "excludeDtsDeps": [
162
- "@svgr/webpack",
163
164
  "babel-loader",
164
165
  "copy-webpack-plugin",
165
166
  "css-loader",
@@ -167,7 +168,7 @@
167
168
  "cssnano",
168
169
  "compression",
169
170
  "connect-history-api-fallback",
170
- "less",
171
+ "fork-ts-checker-webpack-plugin",
171
172
  "less-loader",
172
173
  "mini-css-extract-plugin",
173
174
  "postcss-flexbugs-fixes",
@@ -176,11 +177,11 @@
176
177
  "sass-loader",
177
178
  "speed-measure-webpack-plugin",
178
179
  "style-loader",
179
- "swc-loader",
180
180
  "svgo-loader",
181
181
  "url-loader",
182
182
  "webpack-bundle-analyzer",
183
- "webpack-dev-middleware"
183
+ "webpack-dev-middleware",
184
+ "webpack-manifest-plugin"
184
185
  ]
185
186
  }
186
187
  }
@@ -1,75 +0,0 @@
1
- # replace default config
2
-
3
- # multipass: true
4
- # full: true
5
-
6
- plugins:
7
-
8
- # - name
9
- #
10
- # or:
11
- # - name: false
12
- # - name: true
13
- #
14
- # or:
15
- # - name:
16
- # param1: 1
17
- # param2: 2
18
-
19
- - removeDoctype
20
- - removeXMLProcInst
21
- - removeComments
22
- - removeMetadata
23
- - removeXMLNS
24
- - removeEditorsNSData
25
- - cleanupAttrs
26
- - inlineStyles
27
- - minifyStyles
28
- - convertStyleToAttrs
29
- - cleanupIDs
30
- - prefixIds
31
- - removeRasterImages
32
- - removeUselessDefs
33
- - cleanupNumericValues
34
- - cleanupListOfValues
35
- - convertColors
36
- - removeUnknownsAndDefaults
37
- - removeNonInheritableGroupAttrs
38
- - removeUselessStrokeAndFill
39
- - removeViewBox
40
- - cleanupEnableBackground
41
- - removeHiddenElems
42
- - removeEmptyText
43
- - convertShapeToPath
44
- - convertEllipseToCircle
45
- - moveElemsAttrsToGroup
46
- - moveGroupAttrsToElems
47
- - collapseGroups
48
- - convertPathData
49
- - convertTransform
50
- - removeEmptyAttrs
51
- - removeEmptyContainers
52
- - mergePaths
53
- - removeUnusedNS
54
- - sortAttrs
55
- - sortDefsChildren
56
- - removeTitle
57
- - removeDesc
58
- - removeDimensions
59
- - removeAttrs
60
- - removeAttributesBySelector
61
- - removeElementsByAttr
62
- - addClassesToSVGElement
63
- - removeStyleElement
64
- - removeScriptElement
65
- - addAttributesToSVGElement
66
- - removeOffCanvasPaths
67
- - reusePaths
68
-
69
- # configure the indent (default 4 spaces) used by `--pretty` here:
70
- #
71
- # @see https://github.com/svg/svgo/blob/master/lib/svgo/js2svg.js#L6 for more config options
72
- #
73
- # js2svg:
74
- # pretty: true
75
- # indent: ' '
@@ -1,7 +0,0 @@
1
- Copyright 2017 Smooth Code
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.