webpack auto export
npm install auto-export-plugin
- 如果是非index.js文件改动会自动写入同级目录index.js文件中
- 如果是index.js文件改动会自动写入上层目录的index.js文件中(如果不需要此特性,可以在ignored中写入/index/忽略)
npm i auto-export-plugin -D
`
Usage
`javascript
// webpack.config.js
...
const AutoExport = require('auto-export')module.exports = {
...
plugins: [
...
new AutoExport({
dir: ['src', 'constant'],
ignored: /someFileName|someDirName/
})
]
}
``