sveltejs/svelte-preprocess

Sourcemap not preserved when using external HTML/JS

Open

#382 geöffnet am 6. Juli 2021

Auf GitHub ansehen
 (1 Kommentar) (2 Reaktionen) (0 zugewiesene Personen)TypeScript (150 Forks)auto 404
bughelp wanted

Repository-Metriken

Stars
 (1.798 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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

Contributor Guide