Skip to content

Commit ca3ba6b

Browse files
authored
Merge pull request #4 from hiterm/node_env
Define NODE_ENV
2 parents 89177eb + 52135ec commit ca3ba6b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

utils/buildUtils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ export class Builder {
136136
outdir: distPath(path.dirname(file), targetBrowser),
137137
watch: this.watchOption(targetBrowser),
138138
sourcemap: this.devFlag ? 'inline' : false,
139+
define: {
140+
'process.env.NODE_ENV': this.devFlag
141+
? '"development"'
142+
: '"production"',
143+
},
139144
});
140145
});
141146
this.staticFiles.forEach((file) => {

0 commit comments

Comments
 (0)