Created
September 9, 2017 22:42
-
-
Save clementohNZ/69014b9ab006c01682f43b89ae4d1636 to your computer and use it in GitHub Desktop.
JS Configs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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 | |
} | |
}] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment