@umijs/bundler-esbuild 4.0.51 → 4.0.53

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
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -46,6 +50,7 @@ async function build(opts) {
46
50
  bundle: true,
47
51
  format: opts.format || "iife",
48
52
  logLevel: "error",
53
+ // splitting: true,
49
54
  sourcemap: opts.sourcemap,
50
55
  outdir: outputPath,
51
56
  metafile: true,
@@ -54,6 +59,7 @@ async function build(opts) {
54
59
  modifyVars: opts.config.theme,
55
60
  javascriptEnabled: true,
56
61
  alias: opts.config.alias,
62
+ // ref: https://github.com/umijs/umi-next/pull/214
57
63
  inlineStyle: opts.inlineStyle,
58
64
  config: opts.config,
59
65
  ...opts.config.lessLoader
@@ -66,6 +72,7 @@ async function build(opts) {
66
72
  })
67
73
  ].filter(Boolean),
68
74
  define: {
75
+ // __dirname sham
69
76
  __dirname: JSON.stringify("__dirname"),
70
77
  "process.env.NODE_ENV": JSON.stringify(opts.mode || "development"),
71
78
  ...opts.config.define
package/dist/cli.js CHANGED
@@ -13,6 +13,10 @@ var __copyProps = (to, from, except, desc) => {
13
13
  return to;
14
14
  };
15
15
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
16
20
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
17
21
  mod
18
22
  ));
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -34,6 +38,7 @@ var import_sortByAffix = require("../utils/sortByAffix");
34
38
  var resolver = import_enhanced_resolve.default.create({
35
39
  mainFields: ["module", "browser", "main"],
36
40
  extensions: [".json", ".js", ".jsx", ".ts", ".tsx", ".cjs", ".mjs"],
41
+ // TODO: support exports
37
42
  exportsFields: []
38
43
  });
39
44
  async function resolve(context, path) {
@@ -44,6 +44,7 @@ function hoistAlias(alias) {
44
44
  }
45
45
  function parseAlias(alias) {
46
46
  const wholeAlias = [
47
+ // to support less-loader ~ for local deps, refer: https://github.com/vitejs/vite/issues/2185
47
48
  { find: /^~/, replacement: "" }
48
49
  ];
49
50
  const userAlias = Object.entries(alias).map(([name, target]) => ({
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -49,6 +53,7 @@ var resolver = import_enhanced_resolve.default.create({
49
53
  ".less",
50
54
  ".css"
51
55
  ],
56
+ // TODO: support exports
52
57
  exportsFields: []
53
58
  });
54
59
  async function resolve(context, path2) {
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -50,6 +54,7 @@ function style({
50
54
  charset,
51
55
  minify,
52
56
  loader: {
57
+ // images
53
58
  ".svg": "dataurl",
54
59
  ".png": "dataurl",
55
60
  ".jpg": "dataurl",
@@ -57,6 +62,7 @@ function style({
57
62
  ".gif": "dataurl",
58
63
  ".ico": "dataurl",
59
64
  ".webp": "dataurl",
65
+ // font
60
66
  ".ttf": "dataurl",
61
67
  ".otf": "dataurl",
62
68
  ".woff": "dataurl",
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-esbuild",
3
- "version": "4.0.51",
3
+ "version": "4.0.53",
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.51",
28
- "@umijs/utils": "4.0.51",
27
+ "@umijs/bundler-utils": "4.0.53",
28
+ "@umijs/utils": "4.0.53",
29
29
  "enhanced-resolve": "5.9.3",
30
30
  "postcss": "^8.4.21",
31
31
  "postcss-flexbugs-fixes": "5.0.2",