Add vector tile example using ol-mapbox-style

This commit is contained in:
ahocevar
2018-11-13 13:51:28 +01:00
parent 647421f07b
commit 391fff38aa
4 changed files with 48 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const ExampleBuilder = require('./example-builder');
const fs = require('fs');
@@ -33,7 +33,7 @@ module.exports = {
},
optimization: {
minimizer: [
new UglifyJsPlugin({
new TerserPlugin({
sourceMap: true,
// Do not minify examples that inject code into workers
exclude: [/(color-manipulation|region-growing|raster)\.js/]
@@ -65,5 +65,14 @@ module.exports = {
output: {
filename: '[name].js',
path: path.join(__dirname, '..', '..', 'build', 'examples')
},
node: {
fs: 'empty' // required by ol-mapbox-stlye
},
resolve: {
alias: {
// allow imports from 'ol/module' instead of specifiying the source path
ol: path.join(__dirname, '..', '..', 'src', 'ol')
}
}
};