Last active
January 30, 2017 16:05
-
-
Save olvado/fee1b4415796c86afed6 to your computer and use it in GitHub Desktop.
Webpack config for es6 and rails, with linter
This file contains 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
{ | |
"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 | |
} | |
} |
This file contains 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
/** | |
* @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