2016-10-15 17:16:13 +00:00
|
|
|
var webpack = require('webpack'),
|
2017-07-30 00:40:24 +00:00
|
|
|
bourbon = require('bourbon'),
|
|
|
|
config = require('./config');
|
2016-10-15 16:16:42 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
devtool: 'source-map',
|
|
|
|
entry: {
|
2016-10-15 17:16:13 +00:00
|
|
|
'js/main.js': './src/js/main.js',
|
2016-10-15 20:51:43 +00:00
|
|
|
'__discard__/css/main.css.js': './src/sass/main.scss',
|
|
|
|
'__discard__/css/svg.css.js': './src/sass/svg.scss'
|
2016-10-15 16:16:42 +00:00
|
|
|
},
|
|
|
|
output: {
|
2017-07-30 00:40:24 +00:00
|
|
|
path: config.buildRoot,
|
2016-10-15 16:16:42 +00:00
|
|
|
filename: '[name]'
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
2017-07-30 00:47:04 +00:00
|
|
|
sourceMap: true,
|
2016-10-15 16:16:42 +00:00
|
|
|
compress: {
|
|
|
|
warnings: false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
],
|
|
|
|
module: {
|
|
|
|
loaders: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
2017-07-29 20:18:52 +00:00
|
|
|
loader: 'babel-loader'
|
2016-10-15 16:16:42 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: require.resolve('snapsvg'),
|
|
|
|
loader: 'imports-loader?this=>window,fix=>module.exports=0'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.peg$/,
|
2016-10-15 20:51:43 +00:00
|
|
|
loader: require.resolve('./lib/canopy-loader')
|
2016-10-15 17:16:13 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
|
|
|
exclude: /node_modules/,
|
2017-07-29 20:18:52 +00:00
|
|
|
loaders: [
|
|
|
|
'file-loader?name=css/[name].css',
|
|
|
|
'extract-loader',
|
|
|
|
'css-loader',
|
|
|
|
'sass-loader?includePaths[]=' + bourbon.includePaths
|
|
|
|
]
|
2016-10-15 16:16:42 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|