webpack-bsv
v2.0.3
Published
快速搭建前端React项目,减少webpack配置学习成本
Downloads
112
Readme
Webpack-bsv
快速搭建前端React项目,减少webpack配置学习成本
Install
npm install webpack-bsv --D
Usage
命令
//package.json
{
"script": {
//开发
"start": "bsv",
//打包
"build": "bsv build"
}
}
Spa项目
目录结构
.
+-- public
| +-- index.html
+-- src
| +-- ...
| +-- index.(js)
入口文件
import React from 'react'
import ReactDOM from 'react-dom'
const Home=()=><div>Home</div>
ReactDOM.render(<Home/>, document.querySelector('#root'))
配置文件
允许自定义添加配置文件修改webpack配置 需要在根目录添加.bsv.js文件
属性
属性|说明|备注 ---|---|--- entry|入口配置(只限Spa项目)|参考webpack entry output|输出配置| 参考webpack output publicPath|文件输出目录|参考webpack publicPath alias|别名|默认@为src文件夹 devServer|开发服务器配置|参考webpack devServer port|开发服务器端口号|默认值:6006 babelPlugins|babel插件配置(比如第三方库按需加载)|