Skip to content

Commit

Permalink
Add workaround for Svelte errors
Browse files Browse the repository at this point in the history
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
  • Loading branch information
syvb authored Oct 28, 2020
1 parent d4e2c20 commit 6dfb6b4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ Configure inside your `webpack.config.js`:
test: /\.(html|svelte)$/,
exclude: /node_modules/,
use: 'svelte-loader'
}
},
{
// load Svelte correctly
test: /node_modules\/svelte\/.*\.mjs$/,
resolve: {
fullySpecified: false
}
},
...
]
}
Expand Down

0 comments on commit 6dfb6b4

Please sign in to comment.