@webpack-rewired/core
v0.3.2
Published
merge webpack config
Downloads
9
Readme
Cli
development
webpack-rewired start
production
webpack-rewired build [--report|--statsJson]
参数:
report
: 应用webpack-bundle-analyzer
,插件的配置读取.rewiredrc
文件中的analyzer
项statsJson
:生成stats.json
文件用于分析工具进行 bundle 分析
Config
/* .rewiredrc.js */
module.exports = {
/** 加载内置的配置包@webpack-rewired/* */
builtIns: ['react'],
/** 配置处理函数 */
overrides: [
(webpackConfig, env) => {
return webpackConfig
},
],
/** sass-resources-loader配置 */
sassResources: {
resources: [],
},
/** dll功能的配置 */
dll: {
dev: false,
entry: {
vendor: ['react', 'react-dom'],
},
},
/** webpack-bundle-analyzer配置 */
analyzer: {},
/** devServer配置 */
devServer: {
proxy: {},
},
/** DefinePlugin */
define: {},
/** svg-sprite-loader配置 */
// 默认配置: { symbolId: 'icon-[name]' }
svgSprite: {},
}
Features
eslint
:通过项目根目录的 eslint 配置文件开启typescript
:通过项目根目录的tsconfig.json
配置文件开启dll
:通过.rewiredrc.js
配置文件中的dll
项开启
Todo
- [x] webpack-bundle-analyzer
- [x] dll: 使用autodll-webpack-plugin实现
- [ ] hard-source-webpack-plugin
- [ ] scope hosting