@umijs/bundler-esbuild 4.0.7 → 4.0.8
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/dist/build.d.ts +0 -0
- package/dist/build.js +92 -60
- package/dist/cli.d.ts +0 -0
- package/dist/cli.js +56 -46
- package/dist/index.d.ts +0 -0
- package/dist/index.js +18 -16
- package/dist/plugins/__sample.d.ts +0 -0
- package/dist/plugins/__sample.js +30 -5
- package/dist/plugins/alias.d.ts +0 -0
- package/dist/plugins/alias.js +73 -54
- package/dist/plugins/externals.d.ts +1 -1
- package/dist/plugins/externals.js +45 -21
- package/dist/plugins/less-plugin-alias/index.d.ts +0 -0
- package/dist/plugins/less-plugin-alias/index.js +84 -64
- package/dist/plugins/less-plugin-alias/types.d.ts +0 -0
- package/dist/plugins/less-plugin-alias/types.js +17 -2
- package/dist/plugins/less-plugin-alias/utils.d.ts +0 -0
- package/dist/plugins/less-plugin-alias/utils.js +51 -30
- package/dist/plugins/less.d.ts +0 -0
- package/dist/plugins/less.js +193 -147
- package/dist/plugins/nodeGlobalsPolyfill.d.ts +0 -0
- package/dist/plugins/nodeGlobalsPolyfill.js +36 -12
- package/dist/plugins/style.d.ts +0 -0
- package/dist/plugins/style.js +136 -100
- package/dist/types.d.ts +0 -0
- package/dist/types.js +40 -13
- package/dist/utils/getBrowserlist.d.ts +0 -0
- package/dist/utils/getBrowserlist.js +31 -9
- package/dist/utils/postcssProcess.d.ts +0 -0
- package/dist/utils/postcssProcess.js +59 -22
- package/dist/utils/sortByAffix.d.ts +0 -0
- package/dist/utils/sortByAffix.js +38 -14
- package/package.json +5 -5
|
@@ -1,14 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// nodeGlobalsPolyfill.ts
|
|
20
|
+
var nodeGlobalsPolyfill_exports = {};
|
|
21
|
+
__export(nodeGlobalsPolyfill_exports, {
|
|
22
|
+
nodeGlobalsPolyfill: () => nodeGlobalsPolyfill
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(nodeGlobalsPolyfill_exports);
|
|
4
25
|
function nodeGlobalsPolyfill() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
26
|
+
return {
|
|
27
|
+
name: "node-globals-polyfill",
|
|
28
|
+
setup({ initialOptions, onResolve, onLoad }) {
|
|
29
|
+
onResolve;
|
|
30
|
+
onLoad;
|
|
31
|
+
initialOptions.inject || (initialOptions.inject = []);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
13
34
|
}
|
|
14
|
-
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
nodeGlobalsPolyfill
|
|
38
|
+
});
|
package/dist/plugins/style.d.ts
CHANGED
|
File without changes
|
package/dist/plugins/style.js
CHANGED
|
@@ -1,54 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
4
20
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
21
|
+
var __export = (target, all) => {
|
|
22
|
+
for (var name in all)
|
|
23
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
24
|
+
};
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
|
|
36
|
+
// style.ts
|
|
37
|
+
var style_exports = {};
|
|
38
|
+
__export(style_exports, {
|
|
39
|
+
style: () => style
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(style_exports);
|
|
42
|
+
var import_esbuild = __toESM(require("@umijs/bundler-utils/compiled/esbuild"));
|
|
43
|
+
var import_utils = require("@umijs/utils");
|
|
44
|
+
var import_fs = __toESM(require("fs"));
|
|
45
|
+
var import_path = __toESM(require("path"));
|
|
46
|
+
var import_postcssProcess = require("../utils/postcssProcess");
|
|
47
|
+
function style({
|
|
48
|
+
minify = true,
|
|
49
|
+
charset = "utf8",
|
|
50
|
+
inlineStyle,
|
|
51
|
+
config
|
|
52
|
+
} = {}) {
|
|
53
|
+
return {
|
|
54
|
+
name: "style",
|
|
55
|
+
setup({ onResolve, onLoad }) {
|
|
56
|
+
const cwd = process.cwd();
|
|
57
|
+
const opt = {
|
|
58
|
+
logLevel: "silent",
|
|
59
|
+
bundle: true,
|
|
60
|
+
write: false,
|
|
61
|
+
charset,
|
|
62
|
+
minify,
|
|
63
|
+
loader: {
|
|
64
|
+
".svg": "dataurl",
|
|
65
|
+
".ttf": "dataurl"
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
onResolve({ filter: /\.css$/, namespace: "file" }, (args) => {
|
|
69
|
+
const absPath = import_path.default.resolve(cwd, import_path.default.relative(cwd, args.resolveDir), args.path);
|
|
70
|
+
const resolved = import_fs.default.existsSync(absPath) ? absPath : import_utils.resolve.sync(`${args.path}`, {
|
|
71
|
+
basedir: args.resolveDir
|
|
72
|
+
});
|
|
73
|
+
return { path: resolved, namespace: inlineStyle ? "style-stub" : "" };
|
|
74
|
+
});
|
|
75
|
+
if (inlineStyle) {
|
|
76
|
+
onResolve({ filter: /\.css$/, namespace: "style-stub" }, (args) => {
|
|
77
|
+
return { path: args.path, namespace: "style-content" };
|
|
78
|
+
});
|
|
79
|
+
onResolve({ filter: /^__style_helper__$/, namespace: "style-stub" }, (args) => ({
|
|
80
|
+
path: args.path,
|
|
81
|
+
namespace: "style-helper",
|
|
82
|
+
sideEffects: false
|
|
83
|
+
}));
|
|
84
|
+
onLoad({ filter: /.*/, namespace: "style-helper" }, async () => ({
|
|
85
|
+
contents: `
|
|
52
86
|
export function injectStyle(text) {
|
|
53
87
|
if (typeof document !== 'undefined') {
|
|
54
88
|
var style = document.createElement('style')
|
|
@@ -57,58 +91,60 @@ function style({ minify = true, charset = 'utf8', inlineStyle, config, } = {}) {
|
|
|
57
91
|
document.head.appendChild(style)
|
|
58
92
|
}
|
|
59
93
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
94
|
+
`
|
|
95
|
+
}));
|
|
96
|
+
onLoad({ filter: /.*/, namespace: "style-stub" }, async (args) => ({
|
|
97
|
+
contents: `
|
|
64
98
|
import { injectStyle } from "__style_helper__"
|
|
65
99
|
import css from ${JSON.stringify(args.path)}
|
|
66
100
|
injectStyle(css)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
101
|
+
`
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
onLoad({
|
|
105
|
+
filter: inlineStyle ? /.*/ : /\.css$/,
|
|
106
|
+
namespace: inlineStyle ? "style-content" : "file"
|
|
107
|
+
}, async (args) => {
|
|
108
|
+
const options = __spreadValues({ entryPoints: [args.path] }, opt);
|
|
109
|
+
const { errors, warnings, outputFiles } = await import_esbuild.default.build(options);
|
|
110
|
+
if (errors.length > 0) {
|
|
111
|
+
return {
|
|
112
|
+
errors,
|
|
113
|
+
warnings,
|
|
114
|
+
contents: outputFiles[0].text,
|
|
115
|
+
loader: "text"
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
const dir = import_path.default.dirname(args.path);
|
|
119
|
+
try {
|
|
120
|
+
const result = await (0, import_postcssProcess.postcssProcess)(config, outputFiles[0].text, args.path);
|
|
121
|
+
return {
|
|
122
|
+
errors,
|
|
123
|
+
warnings,
|
|
124
|
+
contents: result.css,
|
|
125
|
+
loader: inlineStyle ? "text" : "css"
|
|
126
|
+
};
|
|
127
|
+
} catch (error) {
|
|
128
|
+
return {
|
|
129
|
+
errors: [
|
|
130
|
+
{
|
|
131
|
+
text: error.message,
|
|
132
|
+
location: {
|
|
133
|
+
namespace: "file",
|
|
134
|
+
file: error.filename,
|
|
135
|
+
line: error.line,
|
|
136
|
+
column: error.column
|
|
83
137
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
return {
|
|
96
|
-
errors: [
|
|
97
|
-
{
|
|
98
|
-
text: error.message,
|
|
99
|
-
location: {
|
|
100
|
-
namespace: 'file',
|
|
101
|
-
file: error.filename,
|
|
102
|
-
line: error.line,
|
|
103
|
-
column: error.column,
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
resolveDir: dir,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
},
|
|
112
|
-
};
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
resolveDir: dir
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
};
|
|
113
146
|
}
|
|
114
|
-
|
|
147
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
148
|
+
0 && (module.exports = {
|
|
149
|
+
style
|
|
150
|
+
});
|
package/dist/types.d.ts
CHANGED
|
File without changes
|
package/dist/types.js
CHANGED
|
@@ -1,13 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
var
|
|
10
|
-
(function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// types.ts
|
|
20
|
+
var types_exports = {};
|
|
21
|
+
__export(types_exports, {
|
|
22
|
+
Env: () => Env,
|
|
23
|
+
JSMinifier: () => JSMinifier
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(types_exports);
|
|
26
|
+
var Env = /* @__PURE__ */ ((Env2) => {
|
|
27
|
+
Env2["development"] = "development";
|
|
28
|
+
Env2["production"] = "production";
|
|
29
|
+
return Env2;
|
|
30
|
+
})(Env || {});
|
|
31
|
+
var JSMinifier = /* @__PURE__ */ ((JSMinifier2) => {
|
|
32
|
+
JSMinifier2["terser"] = "terser";
|
|
33
|
+
JSMinifier2["esbuild"] = "esbuild";
|
|
34
|
+
return JSMinifier2;
|
|
35
|
+
})(JSMinifier || {});
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
Env,
|
|
39
|
+
JSMinifier
|
|
40
|
+
});
|
|
File without changes
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// getBrowserlist.ts
|
|
20
|
+
var getBrowserlist_exports = {};
|
|
21
|
+
__export(getBrowserlist_exports, {
|
|
22
|
+
getBrowserlist: () => getBrowserlist
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(getBrowserlist_exports);
|
|
5
25
|
function getBrowserlist(targets) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}));
|
|
26
|
+
return targets.browsers || Object.keys(targets).map((key) => {
|
|
27
|
+
return `${key} >= ${targets[key] === true ? "0" : targets[key]}`;
|
|
28
|
+
});
|
|
10
29
|
}
|
|
11
|
-
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
getBrowserlist
|
|
33
|
+
});
|
|
File without changes
|
|
@@ -1,25 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
4
20
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
21
|
+
var __export = (target, all) => {
|
|
22
|
+
for (var name in all)
|
|
23
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
24
|
+
};
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
|
|
36
|
+
// postcssProcess.ts
|
|
37
|
+
var postcssProcess_exports = {};
|
|
38
|
+
__export(postcssProcess_exports, {
|
|
39
|
+
postcssProcess: () => postcssProcess
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(postcssProcess_exports);
|
|
42
|
+
var import_postcss = __toESM(require("postcss"));
|
|
43
|
+
var import_getBrowserlist = require("./getBrowserlist");
|
|
9
44
|
async function postcssProcess(config, css, path) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
45
|
+
return await (0, import_postcss.default)([
|
|
46
|
+
require("postcss-flexbugs-fixes"),
|
|
47
|
+
require("postcss-preset-env")({
|
|
48
|
+
browsers: (0, import_getBrowserlist.getBrowserlist)((config == null ? void 0 : config.targets) || {}),
|
|
49
|
+
autoprefixer: __spreadValues({
|
|
50
|
+
flexbox: "no-2009"
|
|
51
|
+
}, config == null ? void 0 : config.autoprefixer),
|
|
52
|
+
stage: 3
|
|
53
|
+
})
|
|
54
|
+
].concat((config == null ? void 0 : config.extraPostCSSPlugins) || [])).process(css, {
|
|
55
|
+
from: path,
|
|
56
|
+
to: path
|
|
57
|
+
});
|
|
24
58
|
}
|
|
25
|
-
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
postcssProcess
|
|
62
|
+
});
|
|
File without changes
|
|
@@ -1,16 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// sortByAffix.ts
|
|
20
|
+
var sortByAffix_exports = {};
|
|
21
|
+
__export(sortByAffix_exports, {
|
|
22
|
+
sortByAffix: () => sortByAffix
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(sortByAffix_exports);
|
|
4
25
|
function sortByAffix(opts) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
26
|
+
return opts.arr.sort((a, b) => {
|
|
27
|
+
if (a.endsWith(opts.affix) && b.endsWith(opts.affix))
|
|
28
|
+
return 0;
|
|
29
|
+
if (a.endsWith(opts.affix))
|
|
30
|
+
return -1;
|
|
31
|
+
if (b.endsWith(opts.affix))
|
|
32
|
+
return 1;
|
|
33
|
+
else
|
|
34
|
+
return 0;
|
|
35
|
+
});
|
|
15
36
|
}
|
|
16
|
-
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
sortByAffix
|
|
40
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/bundler-esbuild",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8",
|
|
4
4
|
"description": "@umijs/bundler-esbuild",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/bundler-esbuild#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "pnpm
|
|
21
|
+
"build": "pnpm father build",
|
|
22
22
|
"build:deps": "umi-scripts bundleDeps",
|
|
23
|
-
"dev": "pnpm
|
|
23
|
+
"dev": "pnpm father dev",
|
|
24
24
|
"test": "umi-scripts jest-turbo"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@umijs/bundler-utils": "4.0.
|
|
28
|
-
"@umijs/utils": "4.0.
|
|
27
|
+
"@umijs/bundler-utils": "4.0.8",
|
|
28
|
+
"@umijs/utils": "4.0.8",
|
|
29
29
|
"enhanced-resolve": "5.9.3",
|
|
30
30
|
"postcss": "^8.4.13",
|
|
31
31
|
"postcss-flexbugs-fixes": "5.0.2",
|