Avoid CDN for frontend CSS and Javascript

Closes: #137
This commit is contained in:
Edward Betts 2024-03-30 10:18:21 +00:00
parent 422cd8aa9d
commit efc660b0ac
6 changed files with 56 additions and 28 deletions

18
webpack.config.js Normal file
View file

@ -0,0 +1,18 @@
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
mode: 'development',
entry: './frontend/index.js', // Ensure this entry point exists and is valid.
plugins: [
new CopyPlugin({
patterns: [
// Copy Bootstrap's CSS and JS from node_modules to your desired location
{ from: 'node_modules/bootstrap/dist', to: path.resolve(__dirname, 'static/bootstrap5') },
{ from: 'node_modules/leaflet/dist', to: path.resolve(__dirname, 'static/leaflet') },
{ from: 'node_modules/leaflet.geodesic/dist', to: path.resolve(__dirname, 'static/leaflet-geodesic'), },
{ from: 'node_modules/es-module-shims/dist', to: path.resolve(__dirname, 'static/es-module-shims') }
],
}),
]
};