Skip to content

Commit 570caa6

Browse files
committed
setup unbuild to inline replace __PACKAGE_VERSION with the current release version
1 parent 079ba60 commit 570caa6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/bundler-plugin-core/build.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defineBuildConfig } from "unbuild";
2+
import packageJson from "./package.json";
23

34
export default defineBuildConfig({
45
entries: ["./src/index"],
@@ -10,5 +11,11 @@ export default defineBuildConfig({
1011
esbuild: {
1112
minify: true,
1213
},
14+
replace: {
15+
preventAssignment: true,
16+
values: {
17+
__PACKAGE_VERSION__: JSON.stringify(packageJson.version),
18+
},
19+
},
1320
},
1421
});

0 commit comments

Comments
 (0)