From f2a749411d177c2940087a3a9641a32ceed82736 Mon Sep 17 00:00:00 2001 From: Smitty Date: Wed, 28 Oct 2020 09:20:45 -0400 Subject: [PATCH] Document workaround for Svelte errors In Webpack 5+, this is required to load Svelte correctly, due to what appears to be code generation issues with TypeScript: https://github.com/microsoft/TypeScript/issues/16577 This works around that by using telling end users to use a newly added feature in Webpack 5+, that uses Webpack 4 behavior for resolving module names: https://webpack.js.org/configuration/module/#resolvefullyspecified --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 61d5a0a1..012d6c86 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,14 @@ Configure inside your `webpack.config.js`: test: /\.(html|svelte)$/, exclude: /node_modules/, use: 'svelte-loader' - } + }, + // Only include this when using Webpack 5+ + { + test: /node_modules\/svelte\/.*\.mjs$/, + resolve: { + fullySpecified: false // load Svelte correctly + } + }, ... ] }