没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
先把webpack安装成全局的
npm --registry http://r.cnpmjs.org install webpack -g
然后初始化package.json
npm init
然后安装webpack和react等插件
npm --registry http://r.cnpmjs.org i babel-core babel-loader babel-preset-es2015 babel-preset-react react react-dom webpack webpack-dev-server --save-dev
然后根据需要搭建目录
然后配置webpack的配置文件webpack.config.js文件
module.exports = {
entry: [
'./src/index.js'
],
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [{
exclude: /node_modules/,
loader: 'babel'
}]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
historyApiFallback: true,
contentBase: './'
npm --registry http://r.cnpmjs.org install webpack -g
然后初始化package.json
npm init
然后安装webpack和react等插件
npm --registry http://r.cnpmjs.org i babel-core babel-loader babel-preset-es2015 babel-preset-react react react-dom webpack webpack-dev-server --save-dev
然后根据需要搭建目录
然后配置webpack的配置文件webpack.config.js文件
module.exports = {
entry: [
'./src/index.js'
],
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [{
exclude: /node_modules/,
loader: 'babel'
}]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
historyApiFallback: true,
contentBase: './'
资源评论
qq_21884555
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功