From 66cf57b0bdde990c3791f3b5490b213888e5ca4d Mon Sep 17 00:00:00 2001 From: Non <19non91@gmail.com> Date: Mon, 11 Jan 2021 18:25:00 +0200 Subject: [PATCH] Make it work with Webpack 5, use webpack-virtual-modules as a dependency --- README.md | 43 +++++++++++++++------ index.js | 32 +++++++++++----- lib/virtual-stats.js | 89 -------------------------------------------- lib/virtual.js | 89 -------------------------------------------- package.json | 5 ++- 5 files changed, 57 insertions(+), 201 deletions(-) delete mode 100644 lib/virtual-stats.js delete mode 100644 lib/virtual.js diff --git a/README.md b/README.md index 61d5a0a1..04d12552 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,13 @@ Configure inside your `webpack.config.js`: test: /\.(html|svelte)$/, exclude: /node_modules/, use: 'svelte-loader' + }, + { + // required to prevent errors from Svelte on Webpack 5+ + test: /svelte\/.*\.mjs$/, + resolve: { + fullySpecified: false + } } ... ] @@ -54,9 +61,13 @@ Webpack's [`resolve.mainFields`](https://webpack.js.org/configuration/resolve/#r If your Svelte components contain `