0, node+npm
1,npm install webpack -g
2,npm install webpack-dev-server -g
3,npm install react react-dom --save
4,npm install jquery --save
5,npm install babel-core babel-loader babel-preset-es2015 babel-preset-react --save-dev //es6
6,npm install url-loader file-loader --save-dev //img
7,npm install css-loader style-loader --save-dev //css
目录:
webpack.config.js:
var path = require(‘path‘); module.exports = { entry: path.resolve(__dirname, ‘src/app.js‘),//源文件目录 output: { path: path.resolve(__dirname, ‘build‘),//构建目录 filename: ‘bundle.js‘ } }
时间: 2024-11-04 22:32:42