Skip to content

Instantly share code, notes, and snippets.

@wegry
Last active September 24, 2016 16:07
Show Gist options
  • Save wegry/84e37fb87c85877415a2040ee84ca0ee to your computer and use it in GitHub Desktop.
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
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