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');
|
|
|
|
|
|
|
|
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
|
|
|
//TODO: Build failure because cannot resolve migrations file
|
2016-11-25 13:31:41 +01:00
|
|
|
//"mapbox-gl-style-spec",
|
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-04-10 10:39:36 +02:00
|
|
|
path: path.join(__dirname, '..', 'public'),
|
2016-12-22 18:08:42 +01:00
|
|
|
filename: '[name].[chunkhash].js',
|
|
|
|
chunkFilename: '[chunkhash].js'
|
2016-11-25 13:31:41 +01:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['', '.js', '.jsx']
|
|
|
|
},
|
|
|
|
module: {
|
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: [
|
|
|
|
new webpack.NoErrorsPlugin(),
|
|
|
|
new webpack.optimize.CommonsChunkPlugin('vendor', '[chunkhash].vendor.js'),
|
|
|
|
new WebpackCleanupPlugin(),
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
|
|
|
NODE_ENV: '"production"'
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
compress: {
|
|
|
|
warnings: false,
|
|
|
|
screw_ie8: true,
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
new webpack.optimize.OccurenceOrderPlugin(),
|
|
|
|
new ExtractTextPlugin('[contenthash].css', {
|
|
|
|
allChunks: true
|
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: './src/template.html',
|
|
|
|
title: 'Maputnik'
|
|
|
|
}),
|
|
|
|
new webpack.optimize.DedupePlugin()
|
|
|
|
]
|
2015-06-15 15:21:19 +02:00
|
|
|
};
|