-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sapper server code minification #3
Comments
Is there a need to minify server side code? Take a look at the official Sapper template. Seems like Node is supporting the nullish coalescing operator from version 14. Setting return commonjsRequire(o,r==null?n.path:r) By the way, I was surprised to find out that |
Oh, that makes sense. @mrazauskas Thanks for the clue.
Mmmmm, unless I misunderstood the statement; this is incorrect. Here is the
And this is the {
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Svelte",
"compilerOptions": {
...
+ "target": "es2017",
...
}
} FWIW, this template was mostly designed a while ago when ESBuild was only at |
Back in Sapper
0.28.0
(#9eb4d43),rollup-plugin-esbuild
was able to bundle and minify Sapper server code without issues.When upgrading to Sapper
0.28.1
(#9332cfc), the following code is added on any generated Sapper server module (src/node_modules/@sapper/server.mjs
) :Which is fine, but when
rollup-plugin-esbuild
tries to minify it, it is adding ES2020 nullish coalescing (a ?? b
) incommonjsRequire(...)
second parameter which leads toSyntaxError: Unexpected token '?'
when starting the server.As a temporary workaround, the Rollup config will minify or not the Sapper server module based on the Sapper version.
The text was updated successfully, but these errors were encountered: