Skip to content

Commit

Permalink
feat: 添加 defaultEnv PACKAGE_VERSION 值为 build 通用 webpack 配置中设置的值
Browse files Browse the repository at this point in the history
  • Loading branch information
孙颢 committed Dec 27, 2018
1 parent bc146aa commit c31f863
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export async function initConfig(

await setWebpack(options, mode)

options.version = argv.version
options.version = options.version || argv.version

buildServiceConfig = options

Expand Down Expand Up @@ -383,7 +383,8 @@ function serverRenderDefaultEnv(
webpack: ConfigOptions.options.webpack = {}
) {
// const isProduction = webpack.mode ? webpack.mode !== 'development' : true
const defaultEnv = ['VUE_ENV', 'PUBLIC_PATH']
const defaultEnv = ['VUE_ENV', 'PUBLIC_PATH', 'PACKAGE_VERSION']
process.env.PACKAGE_VERSION = getConfig().version
env = env.concat(defaultEnv)
consola.info('serverRenderDefaultEnv', env)
app.use(function(req: BuildService.Request, res, next) {
Expand Down

0 comments on commit c31f863

Please sign in to comment.