sveltejs / vite-plugin-svelte

Svelte plugin for http://vitejs.dev/
MIT License
844 stars 103 forks source link

fix: use full filename for svelte.compile #700

Closed dominikg closed 1 year ago

dominikg commented 1 year ago

fixes #699

There is a small chance that this creates a regression with build output still containing absolute paths in sourcemap sources, but in my tests with most recent svelte and vite versions, that is no longer the case.

dominikg commented 1 year ago

looks like the windows test is failing, ran it in my local windows 10 vm and it produced a development build with add_location calls? wtf

dominikg commented 1 year ago

turns out something in our e2e tests sets process.env.NODE_ENV to TEST which caused viteConfig.isProduction to be false, which in turn enabled the svelte compiler option dev.

A better default value for that would be command==='serve' || mode==='development' || process.env.NODE_ENV ==='development' but that is a breaking change, so for now we force production build in our tests via NODE_ENV=production