mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-11-10 08:57:46 +01:00
79 lines
1.9 KiB
JavaScript
79 lines
1.9 KiB
JavaScript
|
|
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 = {
|
|
entry: {
|
|
app: './src/index.jsx',
|
|
vendor: [
|
|
'file-saver',
|
|
'mapbox-gl/dist/mapbox-gl.js',
|
|
//TODO: Build failure because cannot resolve migrations file
|
|
//"mapbox-gl-style-spec",
|
|
"randomcolor",
|
|
"lodash.clonedeep",
|
|
"lodash.throttle",
|
|
"lodash.topairs",
|
|
'color',
|
|
'react',
|
|
"react-dom",
|
|
"react-color",
|
|
"react-file-reader-input",
|
|
"react-collapse",
|
|
"react-height",
|
|
"react-icon-base",
|
|
"react-motion",
|
|
"react-sortable-hoc",
|
|
"request",
|
|
//TODO: Icons raise multi vendor errors?
|
|
//"react-icons",
|
|
]
|
|
},
|
|
output: {
|
|
path: path.join(__dirname, 'public'),
|
|
filename: '[name].[chunkhash].js',
|
|
chunkFilename: '[chunkhash].js'
|
|
},
|
|
resolve: {
|
|
extensions: ['', '.js', '.jsx']
|
|
},
|
|
module: {
|
|
loaders
|
|
},
|
|
node: {
|
|
fs: "empty",
|
|
net: 'empty',
|
|
tls: 'empty'
|
|
},
|
|
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,
|
|
drop_console: true,
|
|
drop_debugger: true
|
|
}
|
|
}),
|
|
new webpack.optimize.OccurenceOrderPlugin(),
|
|
new ExtractTextPlugin('[contenthash].css', {
|
|
allChunks: true
|
|
}),
|
|
new HtmlWebpackPlugin({
|
|
template: './src/template.html',
|
|
title: 'Maputnik'
|
|
}),
|
|
new webpack.optimize.DedupePlugin()
|
|
]
|
|
};
|