2015-06-15 15:21:19 +02:00
|
|
|
|
|
|
|
var webpack = require('webpack');
|
|
|
|
var path = require('path');
|
|
|
|
var loaders = require('./webpack.loaders');
|
|
|
|
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
|
|
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
var WebpackCleanupPlugin = require('webpack-cleanup-plugin');
|
|
|
|
|
2017-07-06 20:53:39 +02:00
|
|
|
var OUTPATH;
|
|
|
|
if(process.env.CIRCLE_ARTIFACTS) {
|
|
|
|
OUTPATH = path.join(process.env.CIRCLE_ARTIFACTS, "build");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
OUTPATH = path.join(__dirname, '..', 'public');
|
|
|
|
}
|
|
|
|
|
2015-06-15 15:21:19 +02:00
|
|
|
module.exports = {
|
2016-11-25 13:31:41 +01:00
|
|
|
entry: {
|
|
|
|
app: './src/index.jsx',
|
|
|
|
vendor: [
|
|
|
|
'file-saver',
|
2016-12-28 19:10:27 +01:00
|
|
|
'mapbox-gl/dist/mapbox-gl.js',
|
2016-12-22 18:08:42 +01:00
|
|
|
"lodash.clonedeep",
|
|
|
|
"lodash.throttle",
|
|
|
|
'color',
|
2016-11-25 13:31:41 +01:00
|
|
|
'react',
|
|
|
|
"react-dom",
|
2016-12-20 11:44:22 +01:00
|
|
|
"react-color",
|
2016-11-25 13:31:41 +01:00
|
|
|
"react-file-reader-input",
|
2016-12-22 18:08:42 +01:00
|
|
|
"react-collapse",
|
|
|
|
"react-height",
|
|
|
|
"react-icon-base",
|
|
|
|
"react-motion",
|
|
|
|
"react-sortable-hoc",
|
|
|
|
"request",
|
2016-11-25 13:31:41 +01:00
|
|
|
//TODO: Icons raise multi vendor errors?
|
|
|
|
//"react-icons",
|
|
|
|
]
|
|
|
|
},
|
|
|
|
output: {
|
2017-07-06 20:53:39 +02:00
|
|
|
path: OUTPATH,
|
2016-12-22 18:08:42 +01:00
|
|
|
filename: '[name].[chunkhash].js',
|
|
|
|
chunkFilename: '[chunkhash].js'
|
2016-11-25 13:31:41 +01:00
|
|
|
},
|
|
|
|
resolve: {
|
2017-11-07 12:35:46 +01:00
|
|
|
extensions: ['.js', '.jsx']
|
2016-11-25 13:31:41 +01:00
|
|
|
},
|
|
|
|
module: {
|
2017-11-07 12:35:46 +01:00
|
|
|
noParse: [
|
|
|
|
/mapbox-gl\/dist\/mapbox-gl.js/,
|
|
|
|
/openlayers\/dist\/ol.js/
|
|
|
|
],
|
2016-12-28 19:10:27 +01:00
|
|
|
loaders
|
2016-11-25 13:31:41 +01:00
|
|
|
},
|
|
|
|
node: {
|
2016-12-19 11:33:13 +01:00
|
|
|
fs: "empty",
|
|
|
|
net: 'empty',
|
|
|
|
tls: 'empty'
|
2016-11-25 13:31:41 +01:00
|
|
|
},
|
|
|
|
plugins: [
|
2017-11-07 12:50:00 +01:00
|
|
|
new webpack.NoEmitOnErrorsPlugin(),
|
2017-11-07 12:35:46 +01:00
|
|
|
new webpack.optimize.CommonsChunkPlugin({ name: 'vendor', filename: '[chunkhash].vendor.js' }),
|
2016-11-25 13:31:41 +01:00
|
|
|
new WebpackCleanupPlugin(),
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
|
|
|
NODE_ENV: '"production"'
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
compress: {
|
|
|
|
warnings: false,
|
|
|
|
screw_ie8: true,
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
new ExtractTextPlugin('[contenthash].css', {
|
|
|
|
allChunks: true
|
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: './src/template.html',
|
|
|
|
title: 'Maputnik'
|
2017-11-07 12:50:00 +01:00
|
|
|
})
|
2016-11-25 13:31:41 +01:00
|
|
|
]
|
2015-06-15 15:21:19 +02:00
|
|
|
};
|