Skip to content

Commit 6dfb6b4

Browse files
authored
Add 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: microsoft/TypeScript#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
1 parent d4e2c20 commit 6dfb6b4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ Configure inside your `webpack.config.js`:
3333
test: /\.(html|svelte)$/,
3434
exclude: /node_modules/,
3535
use: 'svelte-loader'
36-
}
36+
},
37+
{
38+
// load Svelte correctly
39+
test: /node_modules\/svelte\/.*\.mjs$/,
40+
resolve: {
41+
fullySpecified: false
42+
}
43+
},
3744
...
3845
]
3946
}

0 commit comments

Comments
 (0)