mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Allow to create a demo with CJS
This commit is contained in:
parent
0ce283f1d4
commit
514341ddd9
@ -1,15 +1,16 @@
|
||||
const path = require("path");
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const CopyPlugin = require("copy-webpack-plugin");
|
||||
//const CopyPlugin = require("copy-webpack-plugin");
|
||||
const webpack = require("webpack");
|
||||
|
||||
let dist = path.join(__dirname, 'dist/');
|
||||
module.exports = (_env) => ({
|
||||
module.exports = (env) => ({
|
||||
mode: "development",
|
||||
entry: {
|
||||
main: "./index.ts",
|
||||
},
|
||||
experiments: {
|
||||
asyncWebAssembly: true
|
||||
asyncWebAssembly: env.cjs ? false : true
|
||||
},
|
||||
performance: {
|
||||
maxEntrypointSize: 400000,
|
||||
@ -44,8 +45,12 @@ module.exports = (_env) => ({
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
//mainFields: env.cjs ? ['main', 'module'] : undefined,
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.CJS': !!env.cjs
|
||||
}),
|
||||
/*new CopyPlugin({
|
||||
patterns: [
|
||||
// webpack
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user