p5.js-web-editor/webpack.config.prod.js

72 lines
1.4 KiB
JavaScript
Raw Normal View History

2016-06-28 00:46:08 +02:00
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
2016-06-28 20:41:15 +02:00
var cssnext = require('postcss-cssnext');
var postcssFocus = require('postcss-focus');
var postcssReporter = require('postcss-reporter');
var cssnano = require('cssnano');
2016-07-21 02:59:37 +02:00
require('dotenv').config();
2016-06-28 00:46:08 +02:00
module.exports = {
2016-06-28 20:41:15 +02:00
devtool: 'hidden-source-map',
entry: [
2016-07-22 22:45:16 +02:00
'babel-polyfill',
2016-06-28 20:41:15 +02:00
'./client/index.js'
],
2016-06-28 00:46:08 +02:00
output: {
2016-06-28 20:41:15 +02:00
path: __dirname + '/static/dist',
2016-06-28 00:46:08 +02:00
filename: 'bundle.js',
publicPath: '/dist/'
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
module: {
loaders: [
{
test: /\.scss$/,
exclude: /node_modules/,
2016-06-28 20:41:15 +02:00
loaders: ['style', 'css', 'sass', 'postcss']
2016-06-28 00:46:08 +02:00
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel'
},
{
test: /\.svg$/,
loader: 'file'
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production'),
'S3_BUCKET': '"' + process.env.S3_BUCKET + '"'
2016-06-28 00:46:08 +02:00
}
}),
2016-07-23 00:56:54 +02:00
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
2016-06-28 20:41:15 +02:00
],
postcss: () => [
postcssFocus(),
cssnext({
browsers: ['last 2 versions', 'IE > 9']
}),
cssnano({
autoprefixer: false
}),
postcssReporter({
clearMessages: true
})
2016-06-28 00:46:08 +02:00
]
};