From 72b3cc2c47deb62f7c49b8f3fcd0324a927166b6 Mon Sep 17 00:00:00 2001 From: robinvandermolen Date: Wed, 18 Dec 2024 15:21:36 +0100 Subject: [PATCH] :construction_worker: [open-formulieren/open-forms#2177] Update build scripts Both changes are needed for the leaflet-draw and react-leaflet-draw dependencies. leaflet-draw uses images for the different markers, which are included in the css. For this to work with the scss build, .png and .svg files use the dataurl loader https://esbuild.github.io/content-types/#data-url Typescript errors in the react-leaflet-draw dependency caused a typescript validation/error, which shouldn't happen. Using `skipLibCheck` in the tsconfig.json type issues in the node_modules folder are ignored --- bundle-scss.mjs | 4 ++++ tsconfig.json | 1 + 2 files changed, 5 insertions(+) diff --git a/bundle-scss.mjs b/bundle-scss.mjs index ac68b6bc..a0a90f59 100644 --- a/bundle-scss.mjs +++ b/bundle-scss.mjs @@ -5,6 +5,10 @@ await esbuild.build({ entryPoints: ['src/index.ts'], outdir: 'lib/css', bundle: true, + loader: { + ".png": "dataurl", + ".svg": "dataurl", + }, minify: false, sourcemap: true, plugins: [sassPlugin()], diff --git a/tsconfig.json b/tsconfig.json index 589fe44a..cc81f0c5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,6 +18,7 @@ "strictNullChecks": true, "allowSyntheticDefaultImports": true, "noErrorTruncation": true, + "skipLibCheck": true, "paths": { "@/*": ["./*"], "@/sb-decorators": ["../.storybook/decorators.tsx"]