wewowweb / laravel-mix-svelte

mix.svelte();
MIT License
68 stars 10 forks source link

Add webpack config from svelte webpack template #6

Closed JoshuaCrewe closed 4 years ago

JoshuaCrewe commented 4 years ago

This commit takes configuration found in the official svelte webpack template and includes it in this extension. The configuration is specific to svelte development and appears to reduce bugs introduced from including thirds party svelte libraries.

Aims to fix issue #5 .

JoshuaCrewe commented 4 years ago

Lines 27-33 is the configuration which fixes issue #5 . The default webpack behaviour is mainFields: ['browser', 'module', 'main']

The rest of this PR adds configuration found in the Svelte Webapck template. These are not needed for the fix but have been included for completeness.

It is nice to not have to include .svelte in imports and the alias fixes bugs arising from linking modules I think.