Skip to content

Instantly share code, notes, and snippets.

@oleg-voloshyn
Last active March 10, 2016 19:35
Show Gist options
  • Select an option

  • Save oleg-voloshyn/ad5d5f245c378b13d97b to your computer and use it in GitHub Desktop.

Select an option

Save oleg-voloshyn/ad5d5f245c378b13d97b to your computer and use it in GitHub Desktop.
  1. Install next libraries
npm install --save babel-core babel-loader babel-preset-es2015 babel-preset-react express react react-dom webpack
  1. npm init -y for generate package.json file
  2. add to package.file
"repository": {
    "type": "git",
    "url": "https:/your_repo"
  }
  
"scripts": {
   ....,
    "serve": "nodemon server/server.js"
  }
  1. create directory dist
  2. create file webpack.config.js
module.exports = {
  devtool: 'inline-source-map',
  entry: ['./client/client.js'],
  output: {
    path: './dist',
    filename: 'bundle.js',
    publicPath: '/'
  },
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: 'babel-loader',
        exclude: /node_modules/,
        query: {
          presets: ['react', 'es2015']
        }
      }
    ]
  }
}
  1. npm install -g webpack if you run which webpack command, looks like next: /usr/local/bin/webpack

  2. webpack --config webpack.config.js this generate dist/bundle.js

  3. install nodemon npm install -g nodemon

  4. run script npm run serve for start server

  5. Install Redux and components

npm install --save redux react-redux redux-logger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment