Skip to content

Commit b9f202c

Browse files
committed
setup unbuild to inline replace __PACKAGE_VERSION with the current release version
1 parent e6c5c29 commit b9f202c

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,5 +1,6 @@
11
import { defineBuildConfig } from "unbuild";
22
import { codecovRollupPlugin } from "codecovProdRollupPlugin";
3+
import packageJson from "./package.json";
34

45
export default defineBuildConfig({
56
entries: ["./src/index"],
@@ -16,6 +17,12 @@ export default defineBuildConfig({
1617
esbuild: {
1718
minify: true,
1819
},
20+
replace: {
21+
preventAssignment: true,
22+
values: {
23+
__PACKAGE_VERSION__: JSON.stringify(packageJson.version),
24+
},
25+
},
1926
},
2027
hooks: {
2128
"rollup:options": (_ctx, opts) => {

0 commit comments

Comments
 (0)