Last active
September 24, 2016 16:07
-
-
Save wegry/84e37fb87c85877415a2040ee84ca0ee to your computer and use it in GitHub Desktop.
Tree shaking, linting, pre-processed css, and react webpack@^2.1.0-beta.25 config
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
const path = require('path'), | |
ExtractTextPlugin = require('extract-text-webpack-plugin'), | |
webpack = require('webpack') | |
const plugins = [ | |
new ExtractTextPlugin('app.css'), | |
new webpack.LoaderOptionsPlugin({ | |
// test: /\.xxx$/, // may apply this only for some modules | |
options: { | |
eslint: { | |
fix: true, | |
test: /\.js$/, | |
loader: 'eslint-loader', | |
exclude: /node_modules/ | |
} | |
} | |
}) | |
] | |
module.exports = { | |
entry: './app/index.js', | |
output: { | |
filename: 'app.js', | |
path: path.join(__dirname, 'public'), | |
}, | |
devtool: 'source-map', | |
module: { | |
loaders: [ | |
{ | |
test: /\.css$/, | |
loader: ExtractTextPlugin.extract({ | |
fallbackLoader: 'style', | |
loader: 'css!postcss' | |
}) | |
}, | |
] | |
}, | |
plugins | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment