@umijs/bundler-webpack 4.0.0-beta.11 → 4.0.0-beta.15

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 (76) hide show
  1. package/compiled/autoprefixer/browserslist/index.d.ts +7 -7
  2. package/compiled/autoprefixer/index.js +3 -3
  3. package/compiled/autoprefixer/postcss/lib/container.d.ts +2 -2
  4. package/compiled/autoprefixer/postcss/lib/css-syntax-error.d.ts +55 -8
  5. package/compiled/autoprefixer/postcss/lib/input.d.ts +26 -6
  6. package/compiled/autoprefixer/postcss/lib/lazy-result.d.ts +11 -10
  7. package/compiled/autoprefixer/postcss/lib/no-work-result.d.ts +37 -0
  8. package/compiled/autoprefixer/postcss/lib/node.d.ts +36 -2
  9. package/compiled/autoprefixer/postcss/lib/postcss.d.ts +31 -30
  10. package/compiled/autoprefixer/postcss/lib/processor.d.ts +5 -4
  11. package/compiled/autoprefixer/postcss/lib/result.d.ts +3 -2
  12. package/compiled/autoprefixer/postcss/lib/warning.d.ts +37 -3
  13. package/compiled/babel-loader/index.js +2 -2
  14. package/compiled/mini-css-extract-plugin/index.js +6769 -6731
  15. package/compiled/mini-css-extract-plugin/loader.js +1 -1
  16. package/compiled/mini-css-extract-plugin/utils.js +11 -6
  17. package/compiled/postcss-loader/index.js +1 -1
  18. package/compiled/react-refresh/index.js +3 -3
  19. package/compiled/sass-loader/index.js +1 -1
  20. package/compiled/schema-utils/ajv/dist/ajv.d.ts +16 -0
  21. package/compiled/schema-utils/ajv/dist/compile/codegen/code.d.ts +39 -0
  22. package/compiled/schema-utils/ajv/dist/compile/codegen/index.d.ts +79 -0
  23. package/compiled/schema-utils/ajv/dist/compile/codegen/scope.d.ts +79 -0
  24. package/compiled/schema-utils/ajv/dist/compile/errors.d.ts +13 -0
  25. package/compiled/schema-utils/ajv/dist/compile/index.d.ts +80 -0
  26. package/compiled/schema-utils/ajv/dist/compile/ref_error.d.ts +5 -0
  27. package/compiled/schema-utils/ajv/dist/compile/resolve.d.ts +12 -0
  28. package/compiled/schema-utils/ajv/dist/compile/rules.d.ts +28 -0
  29. package/compiled/schema-utils/ajv/dist/compile/util.d.ts +40 -0
  30. package/compiled/schema-utils/ajv/dist/compile/validate/index.d.ts +42 -0
  31. package/compiled/schema-utils/ajv/dist/compile/validate/subschema.d.ts +47 -0
  32. package/compiled/schema-utils/ajv/dist/core.d.ts +171 -0
  33. package/compiled/schema-utils/ajv/dist/runtime/validation_error.d.ts +7 -0
  34. package/compiled/schema-utils/ajv/dist/types/index.d.ts +177 -0
  35. package/compiled/schema-utils/ajv/dist/types/json-schema.d.ts +124 -0
  36. package/compiled/schema-utils/ajv/dist/types/jtd-schema.d.ts +168 -0
  37. package/compiled/schema-utils/declarations/validate.d.ts +4 -4
  38. package/compiled/schema-utils/index.js +8 -2
  39. package/compiled/schema-utils/uri-js/dist/es5/uri.all.d.ts +59 -0
  40. package/compiled/style-loader/index.js +1 -1
  41. package/compiled/terser/index.js +1 -1
  42. package/compiled/terser-webpack-plugin/index.js +328 -451
  43. package/compiled/terser-webpack-plugin/jest-worker/build/types.d.ts +1 -0
  44. package/compiled/terser-webpack-plugin/minify.js +6 -1
  45. package/compiled/terser-webpack-plugin/types/index.d.ts +3 -3
  46. package/compiled/terser-webpack-plugin/types/utils.d.ts +9 -12
  47. package/compiled/terser-webpack-plugin/utils.js +113 -17
  48. package/compiled/webpack/index.js +4915 -4485
  49. package/compiled/webpack-dev-middleware/index.js +11 -5
  50. package/compiled/webpack-sources/index.js +1 -1
  51. package/dist/config/assetRules.js +0 -12
  52. package/dist/config/config.js +8 -1
  53. package/dist/config/harmonyLinkingErrorPlugin.d.ts +6 -0
  54. package/dist/config/harmonyLinkingErrorPlugin.js +39 -0
  55. package/dist/config/javaScriptRules.js +2 -19
  56. package/dist/config/svgRules.d.ts +1 -0
  57. package/dist/config/svgRules.js +17 -3
  58. package/dist/dev.js +10 -5
  59. package/dist/loader/svgr.d.ts +4 -0
  60. package/dist/loader/svgr.js +67 -0
  61. package/dist/loader/swc.d.ts +4 -0
  62. package/dist/loader/swc.js +54 -0
  63. package/dist/plugins/RuntimePublicPathPlugin.d.ts +4 -0
  64. package/dist/plugins/RuntimePublicPathPlugin.js +20 -0
  65. package/dist/schema.js +2 -0
  66. package/dist/server/server.js +18 -1
  67. package/dist/swcPlugins/lockCoreJS.d.ts +6 -0
  68. package/dist/swcPlugins/lockCoreJS.js +23 -0
  69. package/dist/types.d.ts +6 -0
  70. package/package.json +27 -30
  71. package/compiled/@svgr/webpack/LICENSE +0 -7
  72. package/compiled/@svgr/webpack/index.js +0 -266
  73. package/compiled/@svgr/webpack/package.json +0 -1
  74. package/compiled/swc-loader/LICENSE +0 -25
  75. package/compiled/swc-loader/index.js +0 -1
  76. package/compiled/swc-loader/package.json +0 -1
@@ -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';
@@ -34,6 +35,7 @@ declare type IBabelPlugin = Function | string | [string, {
34
35
  export interface IConfig {
35
36
  alias?: Record<string, string>;
36
37
  autoCSSModules?: boolean;
38
+ base?: string;
37
39
  chainWebpack?: Function;
38
40
  copy?: ICopy[] | string[];
39
41
  cssLoader?: {
@@ -97,4 +99,8 @@ export interface IConfig {
97
99
  writeToDisk?: boolean;
98
100
  [key: string]: any;
99
101
  }
102
+ export interface SwcOptions extends SwcConfig {
103
+ sync?: boolean;
104
+ parseMap?: boolean;
105
+ }
100
106
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "4.0.0-beta.11",
3
+ "version": "4.0.0-beta.15",
4
4
  "description": "@umijs/bundler-webpack",
5
5
  "homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-webpack#readme",
6
6
  "bugs": "https://github.com/umijs/umi-next/issues",
@@ -28,27 +28,29 @@
28
28
  "generate:webpackPackages": "zx ./scripts/generateWebpackPackages.mjs"
29
29
  },
30
30
  "dependencies": {
31
- "@pmmmwh/react-refresh-webpack-plugin": "0.5.1",
32
- "@swc/core": "1.2.105",
31
+ "@pmmmwh/react-refresh-webpack-plugin": "0.5.3",
32
+ "@svgr/core": "6.0.0",
33
+ "@svgr/plugin-jsx": "^6.1.0",
34
+ "@svgr/plugin-svgo": "^6.1.0",
35
+ "@swc/core": "1.2.117",
33
36
  "@types/hapi__joi": "17.1.7",
34
- "@umijs/babel-preset-umi": "4.0.0-beta.11",
35
- "@umijs/mfsu": "4.0.0-beta.11",
36
- "@umijs/utils": "4.0.0-beta.11",
37
- "css-loader": "6.5.0",
37
+ "@umijs/babel-preset-umi": "4.0.0-beta.15",
38
+ "@umijs/mfsu": "4.0.0-beta.15",
39
+ "@umijs/utils": "4.0.0-beta.15",
40
+ "css-loader": "6.5.1",
38
41
  "es5-imcompatible-versions": "^0.1.73",
39
- "jest-worker": "27.3.1",
42
+ "jest-worker": "27.4.2",
40
43
  "node-libs-browser": "2.2.1",
41
- "postcss": "^8.3.11",
42
- "postcss-preset-env": "6.7.0",
44
+ "postcss": "^8.4.4",
45
+ "postcss-preset-env": "7.0.1",
43
46
  "react-error-overlay": "6.0.9"
44
47
  },
45
48
  "devDependencies": {
46
- "@svgr/webpack": "6.0.0",
47
49
  "@types/express": "4.17.13",
48
50
  "@types/webpack-sources": "3.2.0",
49
- "@types/ws": "8.2.0",
50
- "autoprefixer": "10.3.7",
51
- "babel-loader": "8.2.2",
51
+ "@types/ws": "8.2.1",
52
+ "autoprefixer": "10.4.0",
53
+ "babel-loader": "8.2.3",
52
54
  "compression": "1.7.4",
53
55
  "connect-history-api-fallback": "1.6.0",
54
56
  "copy-webpack-plugin": "9.0.1",
@@ -58,26 +60,25 @@
58
60
  "http-proxy-middleware": "2.0.1",
59
61
  "less": "4.1.2",
60
62
  "less-loader": "10.2.0",
61
- "mini-css-extract-plugin": "2.4.2",
63
+ "mini-css-extract-plugin": "2.4.5",
62
64
  "postcss-flexbugs-fixes": "5.0.2",
63
- "postcss-loader": "6.2.0",
65
+ "postcss-loader": "6.2.1",
64
66
  "purgecss-webpack-plugin": "4.0.3",
65
- "react-refresh": "0.10.0",
66
- "sass-loader": "12.2.0",
67
- "schema-utils": "3.1.1",
67
+ "react-refresh": "0.11.0",
68
+ "sass-loader": "12.3.0",
69
+ "schema-utils": "4.0.0",
68
70
  "speed-measure-webpack-plugin": "1.5.0",
69
- "style-loader": "3.3.0",
71
+ "style-loader": "3.3.1",
70
72
  "svgo-loader": "3.0.0",
71
- "swc-loader": "0.1.15",
72
73
  "tapable": "2.2.1",
73
- "terser": "5.9.0",
74
- "terser-webpack-plugin": "5.2.4",
74
+ "terser": "5.10.0",
75
+ "terser-webpack-plugin": "5.2.5",
75
76
  "url-loader": "4.1.1",
76
- "webpack": "5.61.0",
77
+ "webpack": "5.64.4",
77
78
  "webpack-5-chain": "8.0.0",
78
79
  "webpack-bundle-analyzer": "4.5.0",
79
- "webpack-dev-middleware": "5.2.1",
80
- "webpack-sources": "3.2.1",
80
+ "webpack-dev-middleware": "5.2.2",
81
+ "webpack-sources": "3.2.2",
81
82
  "ws": "8.2.3"
82
83
  },
83
84
  "publishConfig": {
@@ -88,7 +89,6 @@
88
89
  ],
89
90
  "compiledConfig": {
90
91
  "deps": [
91
- "@svgr/webpack",
92
92
  "autoprefixer",
93
93
  "babel-loader",
94
94
  "copy-webpack-plugin",
@@ -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",
@@ -159,7 +158,6 @@
159
158
  "webpack"
160
159
  ],
161
160
  "excludeDtsDeps": [
162
- "@svgr/webpack",
163
161
  "babel-loader",
164
162
  "copy-webpack-plugin",
165
163
  "css-loader",
@@ -176,7 +174,6 @@
176
174
  "sass-loader",
177
175
  "speed-measure-webpack-plugin",
178
176
  "style-loader",
179
- "swc-loader",
180
177
  "svgo-loader",
181
178
  "url-loader",
182
179
  "webpack-bundle-analyzer",
@@ -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.