Standard ReactJS Procedures
Initialize ReactJS Project
- Enter npm init
- Enter npm install --save-dev babel-core babel-loader babel-preset-react babel-preset-es2015 webpack webpack-dev-server
- Enter npm install --save react react-dom jquery
- Append "scripts": {"start": "node_modules/.bin/webpack-dev-server --progress"},
- Create and edit webpack.config.js:
-
module.exports = {
entry: [
'./src/app.js'
],
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [{
test: /\.jsx?$/,
loader: 'babel',
exclude: 'node_modules',
query: {
presets:['react', 'es2015']
}
}]
}
};
-
- Enter
npm start