Skip to content

Instantly share code, notes, and snippets.

@pechitook
Created August 22, 2016 03:06
Show Gist options
  • Save pechitook/f1b9feb2e15bc3b617ab1fa7d37a992d to your computer and use it in GitHub Desktop.
Save pechitook/f1b9feb2e15bc3b617ab1fa7d37a992d to your computer and use it in GitHub Desktop.
/* eslint-disable no-var */
var webpack = require('webpack');
var cssnano = require('cssnano');
var path = require('path');
var config = {
entry: {
app: './src/index'
},
output: {
filename: '[name].js',
path: path.resolve('build'),
publicPath: '/'
},
resolve: {
root: path.resolve('./src'),
extensions: ['', '.js', '.jsx']
},
module: {
preLoaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'eslint-loader' }
],
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel' },
{ test: /\.scss$/, loader: 'style!css!postcss!sass' },
{ test: /\.(png|svg|jpg)$/, loader: 'url-loader?limit=100000' },
]
},
postcss: [
cssnano({
autoprefixer: {
add: true,
remove: true,
browsers: ['last 2 versions']
},
safe: true,
discardComments: {
removeAll: true
}
})
]
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment