Skip to content
Prev Previous commit
Next Next commit
Build: re-add packages and webpack config changes, that were previous…
…ly removed in the last merge (from master)
  • Loading branch information
Stefanie Hein committed Apr 29, 2024
commit 94b334eb9b5d61838b9f1415604341fb03eb77a0
182 changes: 176 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@
"html-loader": "^0.5.1",
"jest": "^21.2.1",
"leaflet": "^1.7.1",
"leaflet-defaulticon-compatibility": "^0.1.2",
"less": "^2.7.2",
"load-google-maps-api": "^1.3.3",
"marked": "^0.7.0",
"mini-css-extract-plugin": "^2.7.5",
"moment": "^2.29.1",
"postcss-loader": "^3.0.0",
"raw-loader": "^4.0.2",
"resolve-url-loader": "^5.0.0",
"rimraf": "^3.0.2",
"sass": "1.60.0",
"sass-loader": "10.0.5",
Expand Down
5 changes: 3 additions & 2 deletions src/elements/Map/LeafletMap.coffee
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
attributionHtml = require('./leaflet.attribution.html')
require("leaflet/dist/leaflet.js")
# add compatibility with leaflet defaulticon heuristics, // https://github.com/ghybs/leaflet-defaulticon-compatibility, https://github.com/Leaflet/Leaflet/issues/4849
require("leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.js");

class CUI.LeafletMap extends CUI.Map

@defaults =
urlCss: "https://unpkg.com/leaflet@1.2.0/dist/leaflet.css"
tileLayerUrl: 'https://{s}.tile.osm.org/{z}/{x}/{y}.png'
tileLayerOptions:
attribution: attributionHtml
Expand Down Expand Up @@ -242,4 +243,4 @@ class CUI.LeafletMap extends CUI.Map
leafletDeferred.resolve()
else
leafletDeferred.resolve()
leafletDeferred.promise()
leafletDeferred.promise()
12 changes: 10 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports = function (env, argv) {
}),
],
},
devtool: (!isProduction ? 'source-map' : undefined),
devtool: (!isProduction ? 'source-map' : undefined),
module: {
rules: [
{
Expand All @@ -100,11 +100,19 @@ module.exports = function (env, argv) {
sourceMap: true,
}
},
{
// resolve fully relative paths in SCSS, especially when importing CSS from node_modules (leaflet)
loader: 'resolve-url-loader',
options: {
sourceMap: true,
// debug: true
}
},
{
loader: 'sass-loader',
options: {
implementation: require('sass'),
sourceMap: true,
sourceMap: true, // <-- IMPORTANT for resolve-url-loader!
},
},
]
Expand Down