@umijs/bundler-esbuild 4.0.0-beta.16 → 4.0.0-beta.17

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
@@ -46,13 +46,12 @@ function build(opts) {
46
46
  config: opts.config,
47
47
  }),
48
48
  ].filter(Boolean),
49
- define: {
49
+ define: Object.assign({
50
50
  // __dirname sham
51
- __dirname: JSON.stringify('__dirname'),
52
- 'process.env.NODE_ENV': JSON.stringify(opts.mode || 'development'),
53
- },
51
+ __dirname: JSON.stringify('__dirname'), 'process.env.NODE_ENV': JSON.stringify(opts.mode || 'development') }, opts.config.define),
54
52
  loader: {
55
53
  '.svg': 'dataurl',
54
+ '.ttf': 'dataurl',
56
55
  },
57
56
  });
58
57
  });
package/dist/cli.js CHANGED
@@ -21,7 +21,7 @@ const build_1 = require("./build");
21
21
  const args = (0, utils_1.yParser)(process.argv.slice(2), {});
22
22
  const command = args._[0];
23
23
  const cwd = process.cwd();
24
- const entry = tryPaths([
24
+ const entry = (0, utils_1.tryPaths)([
25
25
  (0, path_1.join)(cwd, 'src/index.tsx'),
26
26
  (0, path_1.join)(cwd, 'src/index.ts'),
27
27
  (0, path_1.join)(cwd, 'index.tsx'),
@@ -61,12 +61,6 @@ else {
61
61
  function error(msg) {
62
62
  console.error(utils_1.chalk.red(msg));
63
63
  }
64
- function tryPaths(paths) {
65
- for (const path of paths) {
66
- if ((0, fs_1.existsSync)(path))
67
- return path;
68
- }
69
- }
70
64
  function getEntryKey(path) {
71
65
  return (0, path_1.basename)(path, (0, path_1.extname)(path));
72
66
  }
@@ -33,6 +33,8 @@ function style({ minify = true, charset = 'utf8', inlineStyle, config, } = {}) {
33
33
  minify,
34
34
  loader: {
35
35
  '.svg': 'dataurl',
36
+ // file ?
37
+ '.ttf': 'dataurl',
36
38
  },
37
39
  };
38
40
  onResolve({ filter: /\.css$/, namespace: 'file' }, (args) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-esbuild",
3
- "version": "4.0.0-beta.16",
3
+ "version": "4.0.0-beta.17",
4
4
  "description": "@umijs/bundler-esbuild",
5
5
  "homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-esbuild#readme",
6
6
  "bugs": "https://github.com/umijs/umi-next/issues",
@@ -23,8 +23,8 @@
23
23
  "dev": "pnpm build -- --watch"
24
24
  },
25
25
  "dependencies": {
26
- "@umijs/bundler-utils": "4.0.0-beta.16",
27
- "@umijs/utils": "4.0.0-beta.16",
26
+ "@umijs/bundler-utils": "4.0.0-beta.17",
27
+ "@umijs/utils": "4.0.0-beta.17",
28
28
  "enhanced-resolve": "5.8.3",
29
29
  "less": "4.1.2",
30
30
  "less-plugin-aliases": "^1.0.3",