Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/nutui-taro-demo/config/prod.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
const { execSync } = require('child_process')

const UI = process.env.UI
console.log('UI Review', UI)

let hash = ''
try {
hash = execSync('git rev-parse HEAD').toString().trim().substring(0, 7)
console.log(`当前 Git hash: ${hash}`)
} catch (error) {
/* empty */
}

module.exports = {
env: {
NODE_ENV: '"production"',
},
outputRoot: `dist/${process.env.TARO_ENV === 'h5' ? `demo${hash && UI ? `-${hash}` : ''}` : process.env.TARO_ENV}`,
defineConstants: {},
mini: {},
h5: {
publicPath: '/taro/react/3x/demo',
publicPath: `/taro/react/3x/demo-${hash}`,
/**
* WebpackChain 插件配置
* @docs https://github.com/neutrinojs/webpack-chain
Expand Down
Loading