mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-27 07:05:24 +01:00
ab00c9f426
@storybook 6.4.20 blocks most of others like: react 18, webpack 5, and keeps lots of unnecessary dependencies due to chakra 2 dep.
68 lines
1.6 KiB
JavaScript
68 lines
1.6 KiB
JavaScript
var webpack = require('webpack');
|
|
var path = require('path');
|
|
var rules = require('./webpack.rules');
|
|
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
var HtmlWebpackInlineSVGPlugin = require('html-webpack-inline-svg-plugin');
|
|
var WebpackCleanupPlugin = require('webpack-cleanup-plugin');
|
|
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
var CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
var artifacts = require("../test/artifacts");
|
|
|
|
var OUTPATH = artifacts.pathSync("/build");
|
|
|
|
module.exports = {
|
|
entry: {
|
|
app: './src/index.jsx',
|
|
},
|
|
output: {
|
|
path: OUTPATH,
|
|
filename: '[name].[contenthash].js',
|
|
chunkFilename: '[contenthash].js'
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.jsx']
|
|
},
|
|
module: {
|
|
noParse: [
|
|
/mapbox-gl\/dist\/mapbox-gl.js/
|
|
],
|
|
rules: rules
|
|
},
|
|
node: {
|
|
fs: "empty",
|
|
net: 'empty',
|
|
tls: 'empty'
|
|
},
|
|
plugins: [
|
|
new webpack.NoEmitOnErrorsPlugin(),
|
|
new WebpackCleanupPlugin(),
|
|
new webpack.DefinePlugin({
|
|
'process.env': {
|
|
NODE_ENV: '"production"'
|
|
}
|
|
}),
|
|
new HtmlWebpackPlugin({
|
|
template: './src/template.html',
|
|
title: 'Maputnik'
|
|
}),
|
|
new HtmlWebpackInlineSVGPlugin({
|
|
runPreEmit: true,
|
|
}),
|
|
new CopyWebpackPlugin({
|
|
patterns: [
|
|
{
|
|
from: './src/manifest.json',
|
|
to: 'manifest.json'
|
|
}
|
|
]
|
|
}),
|
|
new BundleAnalyzerPlugin({
|
|
analyzerMode: 'static',
|
|
defaultSizes: 'gzip',
|
|
openAnalyzer: false,
|
|
generateStatsFile: true,
|
|
reportFilename: 'bundle-stats.html',
|
|
statsFilename: 'bundle-stats.json',
|
|
})
|
|
]
|
|
};
|