Skip to content

Commit ccacc38

Browse files
authored
chore: support ui review (#3121)
1 parent 671d996 commit ccacc38

File tree

1 file changed

+15
-1
lines changed
  • packages/nutui-taro-demo/config

1 file changed

+15
-1
lines changed

packages/nutui-taro-demo/config/prod.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1+
const { execSync } = require('child_process')
2+
3+
const UI = process.env.UI
4+
console.log('UI Review', UI)
5+
6+
let hash = ''
7+
try {
8+
hash = execSync('git rev-parse HEAD').toString().trim().substring(0, 7)
9+
console.log(`当前 Git hash: ${hash}`)
10+
} catch (error) {
11+
/* empty */
12+
}
13+
114
module.exports = {
215
env: {
316
NODE_ENV: '"production"',
417
},
18+
outputRoot: `dist/${process.env.TARO_ENV === 'h5' ? `demo${hash && UI ? `-${hash}` : ''}` : process.env.TARO_ENV}`,
519
defineConstants: {},
620
mini: {},
721
h5: {
8-
publicPath: '/taro/react/3x/demo',
22+
publicPath: `/taro/react/3x/demo-${hash}`,
923
/**
1024
* WebpackChain 插件配置
1125
* @docs https://github.com/neutrinojs/webpack-chain

0 commit comments

Comments
 (0)