@umijs/bundler-esbuild 4.0.36 → 4.0.38
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 +1 -3
- package/dist/build.js +8 -3
- package/dist/types.d.ts +3 -1
- package/package.json +3 -3
package/dist/build.d.ts
CHANGED
|
@@ -15,7 +15,5 @@ interface IOpts {
|
|
|
15
15
|
extraBabelPresets?: IBabelPlugin[];
|
|
16
16
|
inlineStyle?: boolean;
|
|
17
17
|
}
|
|
18
|
-
export declare function build(opts: IOpts): Promise<import("@umijs/bundler-utils/compiled/esbuild").BuildResult
|
|
19
|
-
metafile: import("@umijs/bundler-utils/compiled/esbuild").Metafile;
|
|
20
|
-
}>;
|
|
18
|
+
export declare function build(opts: IOpts): Promise<import("@umijs/bundler-utils/compiled/esbuild").BuildResult>;
|
|
21
19
|
export {};
|
package/dist/build.js
CHANGED
|
@@ -33,11 +33,12 @@ var import_externals = __toESM(require("./plugins/externals"));
|
|
|
33
33
|
var import_less = __toESM(require("./plugins/less"));
|
|
34
34
|
var import_style = require("./plugins/style");
|
|
35
35
|
async function build(opts) {
|
|
36
|
+
var _a, _b;
|
|
36
37
|
const outputPath = opts.config.outputPath || (0, import_path.join)(opts.cwd, "dist");
|
|
37
38
|
if (opts.clean) {
|
|
38
39
|
import_utils.rimraf.sync(outputPath);
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
+
const config = {
|
|
41
42
|
entryPoints: opts.entry,
|
|
42
43
|
bundle: true,
|
|
43
44
|
format: opts.format || "iife",
|
|
@@ -69,9 +70,13 @@ async function build(opts) {
|
|
|
69
70
|
loader: {
|
|
70
71
|
".svg": "dataurl",
|
|
71
72
|
".ttf": "dataurl",
|
|
72
|
-
".wasm": "dataurl"
|
|
73
|
+
".wasm": "dataurl",
|
|
74
|
+
...opts.config.loader
|
|
73
75
|
}
|
|
74
|
-
}
|
|
76
|
+
};
|
|
77
|
+
await ((_b = (_a = opts.config).modifyConfig) == null ? void 0 : _b.call(_a, config));
|
|
78
|
+
const result = await (0, import_esbuild.build)(config);
|
|
79
|
+
return result;
|
|
75
80
|
}
|
|
76
81
|
function addCwdPrefix(obj, cwd) {
|
|
77
82
|
Object.keys(obj).forEach((key) => {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransformOptions } from '@umijs/bundler-utils/compiled/esbuild';
|
|
1
|
+
import { TransformOptions, BuildOptions } from '@umijs/bundler-utils/compiled/esbuild';
|
|
2
2
|
export declare enum Env {
|
|
3
3
|
development = "development",
|
|
4
4
|
production = "production"
|
|
@@ -50,5 +50,7 @@ export interface IConfig {
|
|
|
50
50
|
targets?: {
|
|
51
51
|
[key: string]: any;
|
|
52
52
|
};
|
|
53
|
+
loader?: BuildOptions['loader'];
|
|
54
|
+
modifyConfig?: (config: BuildOptions) => void | Promise<void>;
|
|
53
55
|
[key: string]: any;
|
|
54
56
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/bundler-esbuild",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.38",
|
|
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.
|
|
28
|
-
"@umijs/utils": "4.0.
|
|
27
|
+
"@umijs/bundler-utils": "4.0.38",
|
|
28
|
+
"@umijs/utils": "4.0.38",
|
|
29
29
|
"enhanced-resolve": "5.9.3",
|
|
30
30
|
"postcss": "^8.4.13",
|
|
31
31
|
"postcss-flexbugs-fixes": "5.0.2",
|