Skip to content

Commit

Permalink
修改开启hard-source后,修改.umirc配置文件DefinePlugin无效的问题 (umijs#1072)
Browse files Browse the repository at this point in the history
Close umijs#1071

``` 
environmentHash: {
     root: process.cwd(),
     directories: [],
      files: ['package-lock.json', 'yarn.lock'],
},
```
默认情况下 他之监听了这2个文件
https://github.com/mzgoddard/hard-source-webpack-plugin#environmenthash
  • Loading branch information
Jetsly authored and sorrycc committed Sep 13, 2018
1 parent dcb0219 commit 5b55329
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/af-webpack/src/getConfig/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ export default function(webpackConfig, opts) {
}
webpackConfig
.plugin('hard-source')
.use(require('hard-source-webpack-plugin'));
.use(require('hard-source-webpack-plugin'),[{
environmentHash: {
root: process.cwd(),
directories: ['config'],
files: ['package-lock.json', 'yarn.lock', '.umirc.js', '.umirc.local.js'],
},
},
]);
}
}

0 comments on commit 5b55329

Please sign in to comment.