We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 671d996 commit ccacc38Copy full SHA for ccacc38
packages/nutui-taro-demo/config/prod.js
@@ -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
14
module.exports = {
15
env: {
16
NODE_ENV: '"production"',
17
},
18
+ outputRoot: `dist/${process.env.TARO_ENV === 'h5' ? `demo${hash && UI ? `-${hash}` : ''}` : process.env.TARO_ENV}`,
19
defineConstants: {},
20
mini: {},
21
h5: {
- publicPath: '/taro/react/3x/demo',
22
+ publicPath: `/taro/react/3x/demo-${hash}`,
23
/**
24
* WebpackChain 插件配置
25
* @docs https://github.com/neutrinojs/webpack-chain
0 commit comments