File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,9 @@ export default defineBuildConfig({
27
27
hooks : {
28
28
"rollup:options" : ( _ctx , opts ) => {
29
29
if ( process . env . PLUGIN_CODECOV_TOKEN && Array . isArray ( opts . plugins ) ) {
30
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
31
30
opts . plugins = [
32
31
...opts . plugins ,
32
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
33
33
codecovRollupPlugin ( {
34
34
enableBundleAnalysis :
35
35
typeof process . env . PLUGIN_CODECOV_TOKEN === "string" ,
Original file line number Diff line number Diff line change 1
1
import { defineBuildConfig } from "unbuild" ;
2
2
import { codecovRollupPlugin } from "codecovProdRollupPlugin" ;
3
+ import packageJson from "./package.json" ;
3
4
4
5
export default defineBuildConfig ( {
5
6
entries : [ "./src/index" ] ,
@@ -17,13 +18,19 @@ export default defineBuildConfig({
17
18
esbuild : {
18
19
minify : true ,
19
20
} ,
21
+ replace : {
22
+ preventAssignment : true ,
23
+ values : {
24
+ __PACKAGE_VERSION__ : JSON . stringify ( packageJson . version ) ,
25
+ } ,
26
+ } ,
20
27
} ,
21
28
hooks : {
22
29
"rollup:options" : ( _ctx , opts ) => {
23
30
if ( process . env . PLUGIN_CODECOV_TOKEN && Array . isArray ( opts . plugins ) ) {
24
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
25
31
opts . plugins = [
26
32
...opts . plugins ,
33
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
27
34
codecovRollupPlugin ( {
28
35
enableBundleAnalysis :
29
36
typeof process . env . PLUGIN_CODECOV_TOKEN === "string" ,
Original file line number Diff line number Diff line change 1
1
import { defineBuildConfig } from "unbuild" ;
2
2
import { codecovRollupPlugin } from "codecovProdRollupPlugin" ;
3
+ import packageJson from "./package.json" ;
3
4
4
5
export default defineBuildConfig ( {
5
6
entries : [ "./src/index" ] ,
@@ -17,6 +18,12 @@ export default defineBuildConfig({
17
18
esbuild : {
18
19
minify : true ,
19
20
} ,
21
+ replace : {
22
+ preventAssignment : true ,
23
+ values : {
24
+ __PACKAGE_VERSION__ : JSON . stringify ( packageJson . version ) ,
25
+ } ,
26
+ } ,
20
27
} ,
21
28
hooks : {
22
29
"rollup:options" : ( _ctx , opts ) => {
Original file line number Diff line number Diff line change 1
1
import { defineBuildConfig } from "unbuild" ;
2
2
import { codecovRollupPlugin } from "codecovProdRollupPlugin" ;
3
+ import packageJson from "./package.json" ;
3
4
4
5
export default defineBuildConfig ( {
5
6
entries : [ "./src/index" ] ,
@@ -16,6 +17,12 @@ export default defineBuildConfig({
16
17
esbuild : {
17
18
minify : true ,
18
19
} ,
20
+ replace : {
21
+ preventAssignment : true ,
22
+ values : {
23
+ __PACKAGE_VERSION__ : JSON . stringify ( packageJson . version ) ,
24
+ } ,
25
+ } ,
19
26
} ,
20
27
hooks : {
21
28
"rollup:options" : ( _ctx , opts ) => {
You can’t perform that action at this time.
0 commit comments