-
-
Notifications
You must be signed in to change notification settings - Fork 432
dev
flag used by Rollup/webpack configs seems reversed
#590
Comments
JS client sourcemaps seem to be useful: Dev js without sourcemap (current)
Dev js with sourcemap
What tool can read server.js.map? CSS sourcemaps are generated in both build & dev. And never working.
|
I actually found this issue because I was wondering why the server.js sourcemap wasn't present in dev. VS Code's node.js debugger can use source maps so that breakpoints work e.g. in server routes. |
I also remarked this. I have no opinion about build mode (it could be argumented that it could be useful even in prod) but it should be enabled in dev mode. See also #537 about CSS sourcemaps. I push two distinct PRs: one in dev, one in build. |
Thinking about this, I can see the initial reasoning:
Possibly this issue is wontfix, but in this case the variables names should be changed to improve readability and/or comments could be added. |
As I mentioned earlier, source maps are still useful in development when debugging server routes:
Additionally, source maps also map (as their name imply) back to the original source file; since both server- and client-side code is transformed (by Svelte) and bundled (by Rollup) even in development, it is useful to see the original per-component/per-route source, especially when setting breakpoints. |
It appears that source maps are not enabled for
sapper dev
but are enabled forsapper build
. I'm using the sapper/svelte v3 rollup template, and the issue appears to be at the call sites ofcreate_compilers
in the CLI command implementations.Here's some relevant code from some GitHub spelunking:
sapper dev
:sapper/src/api/dev.ts
Line 7 in 411e259
sapper/src/api/dev.ts
Line 220 in 411e259
sapper build
:sapper/src/api/build.ts
Line 4 in e0de230
sapper/src/api/build.ts
Line 85 in e0de230
create_compilers
:sapper/src/core/create_compilers/index.ts
Line 4 in 411e259
sapper/src/core/create_compilers/index.ts
Lines 14 to 23 in 411e259
env.ts
:sapper/src/config/env.ts
Lines 1 to 7 in 411e259
Rollup Config (
sapper/config/rollup.js
):sapper/src/config/rollup.ts
Line 1 in 411e259
sapper/src/config/rollup.ts
Line 20 in 411e259
sapper/src/config/rollup.ts
Line 36 in 411e259
Should I go ahead and submit a pull request to reverse the values passed into
create_compilers
, or is there something I'm not understanding?The text was updated successfully, but these errors were encountered: