Skip to main content

Standard ReactJS Procedures

Initialize ReactJS Project

    1. Enter npm init
    2. Enter npm install --save-dev babel-core babel-loader babel-preset-react babel-preset-es2015 webpack webpack-dev-server
    3. Enter npm install --save react react-dom jquery
    4. Append "scripts": {"start": "node_modules/.bin/webpack-dev-server --progress"},
    5. Create and edit webpack.config.js:
      1. 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']
        }
        }]
        }
        };
    6. Enter npm start