Skip to content

Instantly share code, notes, and snippets.

@clementohNZ
Created September 9, 2017 22:42
Show Gist options
  • Save clementohNZ/69014b9ab006c01682f43b89ae4d1636 to your computer and use it in GitHub Desktop.
Save clementohNZ/69014b9ab006c01682f43b89ae4d1636 to your computer and use it in GitHub Desktop.

Revisions

  1. clementohNZ created this gist Sep 9, 2017.
    30 changes: 30 additions & 0 deletions .eslintrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    {
    "extends": "eslint:recommended",
    "rules": {
    "block-scoped-var": ["warn", "always"],
    "class-methods-use-this": ["warn", "always"],
    "default-case": ["warn", "always"],
    "eqeqeq": ["warn", "always"],
    "no-alert": ["error", "always"],
    "no-empty-function": ["error", "always"],
    "no-eq-null": ["error", "always"],
    "no-implicit-globals": ["error", "always"],
    "no-magic-numbers": ["error", "always"],
    "camelcase": ["error", "always"],
    "comma-dangle": ["error", "always-multiline"],
    "comma-spacing": ["error", {
    "before": false,
    "after": true
    }],
    "no-multiple-empty-lines": ["error", {
    "max": 2
    }]
    },
    "no-multi-spaces": ["error", {
    "exceptions": {
    "VariableDeclarator": true,
    "ImportDeclaration": true,
    "BinaryExpression": true
    }
    }]
    }
    37 changes: 37 additions & 0 deletions webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    // Webpack ver ^1.13.3
    const webpack = require('webpack');
    const path = require('path');

    module.exports = {
    entry: path.join(__dirname, 'src', 'app-client.js'),
    output: {
    path: path.join(__dirname, 'src', 'static', 'js'),
    filename: 'bundle.js'
    },
    module: {
    loaders: [{
    test: path.join(__dirname, 'src'),
    loader: ['babel-loader'],
    query: {
    cacheDirectory: 'babel_cache',
    presets: ['react', 'es2015']
    }
    }]
    },
    plugins: [
    new webpack.DefinePlugin({
    'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
    }),
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.OccurrenceOrderPlugin(),
    new webpack.optimize.UglifyJsPlugin({
    compress: {
    warnings: false
    },
    mangle: true,
    sourcemap: false,
    beautify: false,
    dead_code: true
    })
    ]
    };