@umijs/bundler-webpack 4.0.0-rc.6 → 4.0.0-rc.7
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.
- package/compiled/autoprefixer/browserslist/index.d.ts +2 -0
- package/compiled/autoprefixer/index.js +3 -3
- package/compiled/autoprefixer/postcss/lib/declaration.d.ts +1 -1
- package/compiled/autoprefixer/postcss/lib/node.d.ts +2 -2
- package/compiled/cssnano/index.js +5 -5
- package/compiled/express.d.ts +2 -0
- package/compiled/http-proxy-middleware/index.js +10 -10
- package/compiled/terser/index.js +1 -1
- package/dist/config/cssRules.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/plugins/ParcelCSSMinifyPlugin.d.ts +1 -1
- package/dist/plugins/ParcelCSSMinifyPlugin.js +3 -2
- package/dist/server/server.js +1 -1
- package/package.json +16 -21
- package/compiled/css-loader/LICENSE +0 -20
- package/compiled/css-loader/api.js +0 -102
- package/compiled/css-loader/getUrl.js +0 -29
- package/compiled/css-loader/index.js +0 -2
- package/compiled/css-loader/noSourceMaps.js +0 -5
- package/compiled/css-loader/package.json +0 -1
- package/compiled/css-loader/sourceMaps.js +0 -22
- package/compiled/express/LICENSE +0 -24
- package/compiled/express/body-parser/index.d.ts +0 -104
- package/compiled/express/connect/index.d.ts +0 -93
- package/compiled/express/express-serve-static-core/index.d.ts +0 -1252
- package/compiled/express/index.d.ts +0 -133
- package/compiled/express/index.js +0 -321
- package/compiled/express/mime/index.d.ts +0 -35
- package/compiled/express/package.json +0 -1
- package/compiled/express/qs/index.d.ts +0 -62
- package/compiled/express/range-parser/index.d.ts +0 -35
- package/compiled/express/serve-static/index.d.ts +0 -108
- package/compiled/less/index.js +0 -31
- package/compiled/less/package.json +0 -1
package/dist/config/cssRules.js
CHANGED
|
@@ -20,7 +20,7 @@ function addCSSRules(opts) {
|
|
|
20
20
|
test: /\.less(\?.*)?$/,
|
|
21
21
|
loader: require.resolve('@umijs/bundler-webpack/compiled/less-loader'),
|
|
22
22
|
loaderOptions: {
|
|
23
|
-
implementation: require.resolve('@umijs/bundler-
|
|
23
|
+
implementation: require.resolve('@umijs/bundler-utils/compiled/less'),
|
|
24
24
|
lessOptions: Object.assign({ modifyVars: userConfig.theme, javascriptEnabled: true }, userConfig.lessLoader),
|
|
25
25
|
},
|
|
26
26
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type webpack from '../compiled/webpack';
|
|
2
|
+
export type { RequestHandler } from '@umijs/bundler-utils/compiled/express';
|
|
2
3
|
export type { Compiler, Stats } from '../compiled/webpack';
|
|
3
4
|
export * from './build';
|
|
4
5
|
export * from './config/config';
|
|
5
6
|
export * from './dev';
|
|
6
7
|
export * from './schema';
|
|
8
|
+
export { webpack };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TransformOptions } from '@parcel/css';
|
|
2
2
|
import type { Compiler } from '../../compiled/webpack/types';
|
|
3
3
|
declare type MinifyPluginOpts = Omit<TransformOptions, 'filename' | 'code' | 'minify'>;
|
|
4
4
|
export declare class ParcelCSSMinifyPlugin {
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ParcelCSSMinifyPlugin = void 0;
|
|
13
|
-
const
|
|
13
|
+
const utils_1 = require("@umijs/utils");
|
|
14
14
|
const buffer_1 = require("buffer");
|
|
15
15
|
const path_1 = require("path");
|
|
16
16
|
const webpack_sources_1 = require("../../compiled/webpack-sources");
|
|
@@ -60,7 +60,8 @@ class ParcelCSSMinifyPlugin {
|
|
|
60
60
|
const { source, map } = asset.source.sourceAndMap();
|
|
61
61
|
const sourceAsString = source.toString();
|
|
62
62
|
const code = typeof source === 'string' ? buffer_1.Buffer.from(source) : source;
|
|
63
|
-
const
|
|
63
|
+
const { transform } = (0, utils_1.importLazy)('@parcel/css');
|
|
64
|
+
const result = yield transform(Object.assign({ filename: asset.name, code, minify: true, sourceMap: sourcemap }, this.options));
|
|
64
65
|
const codeString = result.code.toString();
|
|
65
66
|
compilation.updateAsset(asset.name,
|
|
66
67
|
// @ts-ignore
|
package/dist/server/server.js
CHANGED
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.createServer = void 0;
|
|
16
|
-
const express_1 = __importDefault(require("@umijs/bundler-
|
|
16
|
+
const express_1 = __importDefault(require("@umijs/bundler-utils/compiled/express"));
|
|
17
17
|
const http_proxy_middleware_1 = require("@umijs/bundler-webpack/compiled/http-proxy-middleware");
|
|
18
18
|
const webpack_1 = __importDefault(require("@umijs/bundler-webpack/compiled/webpack"));
|
|
19
19
|
const utils_1 = require("@umijs/utils");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/bundler-webpack",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.7",
|
|
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",
|
|
@@ -25,42 +25,40 @@
|
|
|
25
25
|
"build:client": "pnpm tsc --project ./tsconfig.client.json",
|
|
26
26
|
"build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
|
|
27
27
|
"dev": "pnpm build -- --watch",
|
|
28
|
-
"generate:webpackPackages": "zx ./scripts/generateWebpackPackages.mjs"
|
|
28
|
+
"generate:webpackPackages": "zx ./scripts/generateWebpackPackages.mjs",
|
|
29
|
+
"test": "jest -c ../../jest.turbo.config.ts"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@parcel/css": "1.
|
|
32
|
+
"@parcel/css": "1.6.0",
|
|
32
33
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.4",
|
|
33
34
|
"@svgr/core": "6.2.1",
|
|
34
35
|
"@svgr/plugin-jsx": "^6.2.1",
|
|
35
36
|
"@svgr/plugin-svgo": "^6.2.0",
|
|
36
37
|
"@types/hapi__joi": "17.1.8",
|
|
37
|
-
"@umijs/babel-preset-umi": "4.0.0-rc.
|
|
38
|
-
"@umijs/mfsu": "4.0.0-rc.
|
|
39
|
-
"@umijs/utils": "4.0.0-rc.
|
|
38
|
+
"@umijs/babel-preset-umi": "4.0.0-rc.7",
|
|
39
|
+
"@umijs/mfsu": "4.0.0-rc.7",
|
|
40
|
+
"@umijs/utils": "4.0.0-rc.7",
|
|
40
41
|
"css-loader": "6.7.1",
|
|
41
42
|
"es5-imcompatible-versions": "^0.1.73",
|
|
42
43
|
"jest-worker": "27.5.1",
|
|
43
44
|
"node-libs-browser": "2.2.1",
|
|
44
|
-
"postcss": "^8.4.
|
|
45
|
+
"postcss": "^8.4.12",
|
|
45
46
|
"postcss-preset-env": "7.4.2",
|
|
46
47
|
"react-error-overlay": "6.0.9"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@swc/core": "1.2.
|
|
50
|
-
"@types/express": "4.17.13",
|
|
50
|
+
"@swc/core": "1.2.156",
|
|
51
51
|
"@types/webpack-sources": "3.2.0",
|
|
52
|
-
"@types/ws": "8.5.
|
|
53
|
-
"autoprefixer": "10.4.
|
|
52
|
+
"@types/ws": "8.5.3",
|
|
53
|
+
"autoprefixer": "10.4.4",
|
|
54
54
|
"babel-loader": "8.2.3",
|
|
55
55
|
"compression": "1.7.4",
|
|
56
56
|
"connect-history-api-fallback": "1.6.0",
|
|
57
57
|
"copy-webpack-plugin": "10.2.4",
|
|
58
58
|
"css-minimizer-webpack-plugin": "3.4.1",
|
|
59
|
-
"cssnano": "5.1.
|
|
60
|
-
"express": "4.17.3",
|
|
59
|
+
"cssnano": "5.1.4",
|
|
61
60
|
"fork-ts-checker-webpack-plugin": "7.2.1",
|
|
62
|
-
"http-proxy-middleware": "2.0.
|
|
63
|
-
"less": "4.1.2",
|
|
61
|
+
"http-proxy-middleware": "2.0.4",
|
|
64
62
|
"less-loader": "10.2.0",
|
|
65
63
|
"mini-css-extract-plugin": "2.6.0",
|
|
66
64
|
"postcss-flexbugs-fixes": "5.0.2",
|
|
@@ -73,7 +71,7 @@
|
|
|
73
71
|
"style-loader": "3.3.1",
|
|
74
72
|
"svgo-loader": "3.0.0",
|
|
75
73
|
"tapable": "2.2.1",
|
|
76
|
-
"terser": "5.12.
|
|
74
|
+
"terser": "5.12.1",
|
|
77
75
|
"terser-webpack-plugin": "5.3.1",
|
|
78
76
|
"url-loader": "4.1.1",
|
|
79
77
|
"webpack": "5.70.0",
|
|
@@ -100,10 +98,8 @@
|
|
|
100
98
|
"cssnano",
|
|
101
99
|
"compression",
|
|
102
100
|
"connect-history-api-fallback",
|
|
103
|
-
"express",
|
|
104
101
|
"fork-ts-checker-webpack-plugin",
|
|
105
102
|
"http-proxy-middleware",
|
|
106
|
-
"less",
|
|
107
103
|
"less-loader",
|
|
108
104
|
"mini-css-extract-plugin",
|
|
109
105
|
"postcss-flexbugs-fixes",
|
|
@@ -132,9 +128,9 @@
|
|
|
132
128
|
"@babel/core": "@umijs/bundler-utils/compiled/babel/core",
|
|
133
129
|
"es-module-lexer": "@umijs/bundler-utils/compiled/es-module-lexer",
|
|
134
130
|
"esbuild": "@umijs/bundler-utils/compiled/esbuild",
|
|
135
|
-
"express": "
|
|
131
|
+
"express": "@umijs/bundler-utils/compiled/express",
|
|
136
132
|
"jest-worker": "jest-worker",
|
|
137
|
-
"less": "
|
|
133
|
+
"less": "@umijs/bundler-utils/compiled/less",
|
|
138
134
|
"cssnano": "$$LOCAL",
|
|
139
135
|
"postcss": "postcss",
|
|
140
136
|
"tapable": "$$LOCAL",
|
|
@@ -173,7 +169,6 @@
|
|
|
173
169
|
"compression",
|
|
174
170
|
"connect-history-api-fallback",
|
|
175
171
|
"fork-ts-checker-webpack-plugin",
|
|
176
|
-
"less",
|
|
177
172
|
"less-loader",
|
|
178
173
|
"mini-css-extract-plugin",
|
|
179
174
|
"postcss-flexbugs-fixes",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Copyright JS Foundation and other contributors
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
-
a copy of this software and associated documentation files (the
|
|
5
|
-
'Software'), to deal in the Software without restriction, including
|
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
-
the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be
|
|
12
|
-
included in all copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
17
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
18
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
20
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
5
|
-
Author Tobias Koppers @sokra
|
|
6
|
-
*/
|
|
7
|
-
module.exports = function (cssWithMappingToString) {
|
|
8
|
-
var list = []; // return the list of modules as css string
|
|
9
|
-
|
|
10
|
-
list.toString = function toString() {
|
|
11
|
-
return this.map(function (item) {
|
|
12
|
-
var content = "";
|
|
13
|
-
var needLayer = typeof item[5] !== "undefined";
|
|
14
|
-
|
|
15
|
-
if (item[4]) {
|
|
16
|
-
content += "@supports (".concat(item[4], ") {");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (item[2]) {
|
|
20
|
-
content += "@media ".concat(item[2], " {");
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (needLayer) {
|
|
24
|
-
content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
content += cssWithMappingToString(item);
|
|
28
|
-
|
|
29
|
-
if (needLayer) {
|
|
30
|
-
content += "}";
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (item[2]) {
|
|
34
|
-
content += "}";
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (item[4]) {
|
|
38
|
-
content += "}";
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return content;
|
|
42
|
-
}).join("");
|
|
43
|
-
}; // import a list of modules into the list
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
list.i = function i(modules, media, dedupe, supports, layer) {
|
|
47
|
-
if (typeof modules === "string") {
|
|
48
|
-
modules = [[null, modules, undefined]];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
var alreadyImportedModules = {};
|
|
52
|
-
|
|
53
|
-
if (dedupe) {
|
|
54
|
-
for (var _i = 0; _i < this.length; _i++) {
|
|
55
|
-
var id = this[_i][0];
|
|
56
|
-
|
|
57
|
-
if (id != null) {
|
|
58
|
-
alreadyImportedModules[id] = true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
for (var _i2 = 0; _i2 < modules.length; _i2++) {
|
|
64
|
-
var item = [].concat(modules[_i2]);
|
|
65
|
-
|
|
66
|
-
if (dedupe && alreadyImportedModules[item[0]]) {
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (typeof layer !== "undefined") {
|
|
71
|
-
if (typeof item[5] === "undefined") {
|
|
72
|
-
item[5] = layer;
|
|
73
|
-
} else {
|
|
74
|
-
item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
|
|
75
|
-
item[5] = layer;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (media) {
|
|
80
|
-
if (!item[2]) {
|
|
81
|
-
item[2] = media;
|
|
82
|
-
} else {
|
|
83
|
-
item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
|
|
84
|
-
item[2] = media;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (supports) {
|
|
89
|
-
if (!item[4]) {
|
|
90
|
-
item[4] = "".concat(supports);
|
|
91
|
-
} else {
|
|
92
|
-
item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
|
|
93
|
-
item[4] = supports;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
list.push(item);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
return list;
|
|
102
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = function (url, options) {
|
|
4
|
-
if (!options) {
|
|
5
|
-
options = {};
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if (!url) {
|
|
9
|
-
return url;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
url = String(url.__esModule ? url.default : url); // If url is already wrapped in quotes, remove them
|
|
13
|
-
|
|
14
|
-
if (/^['"].*['"]$/.test(url)) {
|
|
15
|
-
url = url.slice(1, -1);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (options.hash) {
|
|
19
|
-
url += options.hash;
|
|
20
|
-
} // Should url be wrapped?
|
|
21
|
-
// See https://drafts.csswg.org/css-values-3/#urls
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (/["'() \t\n]|(%20)/.test(url) || options.needQuotes) {
|
|
25
|
-
return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, "\\n"), "\"");
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return url;
|
|
29
|
-
};
|