From a7a5b7fd63c59710a53971587772966ced60f818 Mon Sep 17 00:00:00 2001 From: sua yoo Date: Tue, 7 Feb 2023 13:58:14 -0800 Subject: [PATCH] test: add shoelace form utility to import map Temporarily fixes test build error, see FIXME --- frontend/web-test-runner.config.mjs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/web-test-runner.config.mjs b/frontend/web-test-runner.config.mjs index c3ffc757..eacc7fac 100644 --- a/frontend/web-test-runner.config.mjs +++ b/frontend/web-test-runner.config.mjs @@ -45,6 +45,18 @@ export default { "@shoelace-style/shoelace/dist/themes/light.css": fileURLToPath( new URL("./src/__mocks__/css.js", import.meta.url) ), + // FIXME: `@web/dev-server-esbuild` or its dependencies seem to be ignoring .js + // extension and shoelace exports and switching it to .ts + // Needs a better solution than import mapping individual files. + // Maybe related: + // - https://github.com/modernweb-dev/web/issues/1929 + // - https://github.com/modernweb-dev/web/issues/224 + "@shoelace-style/shoelace/dist/utilities/form.js": fileURLToPath( + new URL( + "./node_modules/@shoelace-style/shoelace/dist/utilities/form.js", + import.meta.url + ) + ), // "@formatjs/intl-displaynames/should-polyfill": new URL( // "./src/__mocks__/@formatjs/intl-displaynames/should-polyfill.js", // import.meta.url