@umijs/bundler-esbuild 4.0.20 → 4.0.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.
package/dist/build.js CHANGED
@@ -2,22 +2,8 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
5
  var __getProtoOf = Object.getPrototypeOf;
7
6
  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;
20
- };
21
7
  var __export = (target, all) => {
22
8
  for (var name in all)
23
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -60,13 +46,14 @@ async function build(opts) {
60
46
  outdir: outputPath,
61
47
  metafile: true,
62
48
  plugins: [
63
- (0, import_less.default)(__spreadValues({
49
+ (0, import_less.default)({
64
50
  modifyVars: opts.config.theme,
65
51
  javascriptEnabled: true,
66
52
  alias: opts.config.alias,
67
53
  inlineStyle: opts.inlineStyle,
68
- config: opts.config
69
- }, opts.config.lessLoader)),
54
+ config: opts.config,
55
+ ...opts.config.lessLoader
56
+ }),
70
57
  opts.config.alias && (0, import_alias.default)(addCwdPrefix(opts.config.alias, opts.cwd)),
71
58
  opts.config.externals && (0, import_externals.default)(opts.config.externals),
72
59
  (0, import_style.style)({
@@ -74,13 +61,15 @@ async function build(opts) {
74
61
  config: opts.config
75
62
  })
76
63
  ].filter(Boolean),
77
- define: __spreadValues({
64
+ define: {
78
65
  __dirname: JSON.stringify("__dirname"),
79
- "process.env.NODE_ENV": JSON.stringify(opts.mode || "development")
80
- }, opts.config.define),
66
+ "process.env.NODE_ENV": JSON.stringify(opts.mode || "development"),
67
+ ...opts.config.define
68
+ },
81
69
  loader: {
82
70
  ".svg": "dataurl",
83
- ".ttf": "dataurl"
71
+ ".ttf": "dataurl",
72
+ ".wasm": "dataurl"
84
73
  }
85
74
  });
86
75
  }
@@ -1,38 +1,9 @@
1
1
  var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
5
  var __getProtoOf = Object.getPrototypeOf;
9
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues = (a, b) => {
13
- for (var prop in b || (b = {}))
14
- if (__hasOwnProp.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- if (__getOwnPropSymbols)
17
- for (var prop of __getOwnPropSymbols(b)) {
18
- if (__propIsEnum.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- }
21
- return a;
22
- };
23
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __objRest = (source, exclude) => {
25
- var target = {};
26
- for (var prop in source)
27
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
- target[prop] = source[prop];
29
- if (source != null && __getOwnPropSymbols)
30
- for (var prop of __getOwnPropSymbols(source)) {
31
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
- target[prop] = source[prop];
33
- }
34
- return target;
35
- };
36
7
  var __export = (target, all) => {
37
8
  for (var name in all)
38
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -110,7 +81,7 @@ var aliasLessImportPath = async (filePath, alias, importer) => {
110
81
  return null;
111
82
  };
112
83
  var less_default = (options = {}) => {
113
- const _a = options, { alias, inlineStyle, config } = _a, lessOptions = __objRest(_a, ["alias", "inlineStyle", "config"]);
84
+ const { alias, inlineStyle, config, ...lessOptions } = options;
114
85
  return {
115
86
  name: "less",
116
87
  setup({ onResolve, onLoad }) {
@@ -163,17 +134,17 @@ var less_default = (options = {}) => {
163
134
  const dir = import_path.default.dirname(args.path);
164
135
  const filename = import_path.default.basename(args.path);
165
136
  try {
166
- const result = await import_less.default.render(content, __spreadProps(__spreadValues({
137
+ const result = await import_less.default.render(content, {
167
138
  plugins: [
168
139
  new import_less_plugin_alias.default({
169
140
  alias: alias || {}
170
141
  })
171
142
  ],
172
143
  filename,
173
- rootpath: dir
174
- }, lessOptions), {
144
+ rootpath: dir,
145
+ ...lessOptions,
175
146
  paths: [...lessOptions.paths || [], dir]
176
- }));
147
+ });
177
148
  const postcssrResult = await (0, import_postcssProcess.postcssProcess)(config, result.css, args.path);
178
149
  return {
179
150
  contents: postcssrResult.css,
@@ -2,22 +2,8 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
5
  var __getProtoOf = Object.getPrototypeOf;
7
6
  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;
20
- };
21
7
  var __export = (target, all) => {
22
8
  for (var name in all)
23
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -105,7 +91,7 @@ function style({
105
91
  filter: inlineStyle ? /.*/ : /\.css$/,
106
92
  namespace: inlineStyle ? "style-content" : "file"
107
93
  }, async (args) => {
108
- const options = __spreadValues({ entryPoints: [args.path] }, opt);
94
+ const options = { entryPoints: [args.path], ...opt };
109
95
  const { errors, warnings, outputFiles } = await import_esbuild.default.build(options);
110
96
  if (errors.length > 0) {
111
97
  return {
@@ -2,22 +2,8 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
5
  var __getProtoOf = Object.getPrototypeOf;
7
6
  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;
20
- };
21
7
  var __export = (target, all) => {
22
8
  for (var name in all)
23
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -46,9 +32,10 @@ async function postcssProcess(config, css, path) {
46
32
  require("postcss-flexbugs-fixes"),
47
33
  require("postcss-preset-env")({
48
34
  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),
35
+ autoprefixer: {
36
+ flexbox: "no-2009",
37
+ ...config == null ? void 0 : config.autoprefixer
38
+ },
52
39
  stage: 3
53
40
  })
54
41
  ].concat((config == null ? void 0 : config.extraPostCSSPlugins) || [])).process(css, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-esbuild",
3
- "version": "4.0.20",
3
+ "version": "4.0.22",
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",
@@ -24,8 +24,8 @@
24
24
  "test": "umi-scripts jest-turbo"
25
25
  },
26
26
  "dependencies": {
27
- "@umijs/bundler-utils": "4.0.20",
28
- "@umijs/utils": "4.0.20",
27
+ "@umijs/bundler-utils": "4.0.22",
28
+ "@umijs/utils": "4.0.22",
29
29
  "enhanced-resolve": "5.9.3",
30
30
  "postcss": "^8.4.13",
31
31
  "postcss-flexbugs-fixes": "5.0.2",