Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Svelte REPL broken on svelte.dev #1493

Closed
benmccann opened this issue Sep 7, 2020 · 1 comment · Fixed by #1494
Closed

Svelte REPL broken on svelte.dev #1493

benmccann opened this issue Sep 7, 2020 · 1 comment · Fixed by #1494

Comments

@benmccann
Copy link
Member

benmccann commented Sep 7, 2020

codemirror.css is not being included. It looks like Repl.js dynamically imports codemirror.js which imports codemirror.css. In 0.28.0 it got stuck into main.css

@benmccann
Copy link
Member Author

The trigger for the problem is that the index route imports the REPL and the repl route dynamically imports the REPL. As a result, codemirror.js has already been added to processed_chunks and isn't seen as a leftover chunk from a dynamic import.

It seems the original algorithm of just sticking the leftover stuff in the application entry chunk isn't going to work. We could probably solve it by making the existing algorithm even more complicated:

  • Find all dynamically imported chunks that are not routes
  • Calculate the transitive dependency tree of each dynamically imported route
  • Include the css for each of these trees in the application entry chunk

The reason this had not been reported in previous versions of Sapper is because Sapper duplicated all CSS into main.css (#1076 #1127)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant