Skip to content

Instantly share code, notes, and snippets.

@olvado
Last active January 30, 2017 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save olvado/fee1b4415796c86afed6 to your computer and use it in GitHub Desktop.
Save olvado/fee1b4415796c86afed6 to your computer and use it in GitHub Desktop.
Webpack config for es6 and rails, with linter
{
"parser": "babel-eslint",
"plugins": [
"react"
],
"env": {
"browser": true,
"node": true
},
"rules": {
"new-cap": 0,
"no-debugger": 0,
"strict": [2, "never"],
"quotes": [2, "single"],
"react/jsx-boolean-value": 1,
"react/jsx-quotes": 1,
"react/jsx-no-undef": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-multi-comp": 1,
"react/prop-types": 1,
"react/self-closing-comp": 1,
"react/wrap-multilines": 1
},
"globals": {
"FIREBASE": true
}
}
/**
* @see http://webpack.github.io/docs/configuration.html
* for webpack configuration options
*/
var path = require('path');
var node_modules_dir = path.join(__dirname, 'node_modules');
var javascripts_path = path.join(__dirname, 'app', 'assets', 'javascripts');
module.exports = {
devtool: 'inline-source-map',
entry: path.join(javascripts_path, '_application.js'),
output: {
filename: '[name].bundle.js',
path: javascripts_path
},
module: {
preLoaders: [{
test: /\.js$/,
loader: 'eslint-loader',
include: javascripts_path,
exclude: [node_modules_dir]
}],
loaders: [{
test: /\.js$/,
loaders: ['babel?stage=0&optional=runtime'],
include: javascripts_path,
exclude: [node_modules_dir]
}]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment