Skip to content

Commit

Permalink
[WebComponentsEditor] 修复升级到 vite v3 后, 打包后的组件代码中包含 process.env.* 的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang-Wei-666 committed Jul 25, 2022
1 parent a21545a commit 2aa9f15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions WebComponentsEditor/scripts/build.ts
Expand Up @@ -51,6 +51,9 @@ const outDirPath = resolve(rootPath, 'dist');
const viteExtraConfig: InlineConfig = {
configFile: viteConfigPath ? resolve(srcPath, viteConfigPath) : false,
publicDir: resolve(rootPath, 'public', name),
define: {
'process.env.NODE_ENV': JSON.stringify('production'),
},
build: {
minify: true,
outDir: resolve(outDirPath, name),
Expand Down

0 comments on commit 2aa9f15

Please sign in to comment.