sveltejs / sapper-template

Starter template for Sapper apps
703 stars 214 forks source link

Rollup 2: warning: preserveEntrySignatures #218

Closed frederikhors closed 4 years ago

frederikhors commented 4 years ago

Trying with Rollup 2 I get this in console:

• client
To preserve the export signature of the entry module "src\client.js", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.
thgh commented 4 years ago

This breaks now-sapper because it also removes the intentional export in the server: export default polka() It can be worked-around by writing module.exports = polka()

Conduitry commented 4 years ago

Hm I had wondered about that. An extra chunk on the server side probably aren't that big of a deal at all - would it work to make just the server bundle have preserveEntrySignatures: 'strict' instead?

thgh commented 4 years ago

Just tested 'strict' and indeed, that works! It seems that the current template is not creating chunks, everything is packed in 1 file. (the value of preserveEntrySignatures doesn't matter)

Conduitry commented 4 years ago

:+1: Updated in c5bd6f061c80531ecfdd4444457fb6d865f7f34d