Created
August 22, 2016 03:06
-
-
Save pechitook/f1b9feb2e15bc3b617ab1fa7d37a992d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* 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