Skip to content

Sourcemap not preserved when using external HTML/JS #382

Open
@nolanlawson

Description

@nolanlawson

Describe the bug

When using external HTML/JS files, it seems that sourcemaps are not preserved, even with all sourcemap options set to true (on svelte options, rollup options, and svelte-preprocess options).

Using a single .svelte file instead of external HTML/JS files seems to fix the issue.

To Reproduce

I wrote a minimal repro. To run it:

git clone https://gist.github.com/4a7b3e5cb94626a97352435de79fbfac.git repro
cd repro
npm i
npm start

Then go to localhost:8080 and open the Chrome DevTools.

Expected behavior

The DevTools should show the actual line of code with the debugger statement. Instead, it shows the .svelte file which just lists the external resources:

Screenshot from 2021-07-06 08-27-06

Information about your project:

Chrome 91, Ubuntu 20.04, svelte-preprocess 4.7.3, Rollup 2.52.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions