Would be great to have a way to include a regular script tag (not component definition).
REPL
Some considerations off the top of my head:
Also, I encountered the issue when using Svelte as a primary server-side renderer:
<html>
<body>
<div id="mount"></div>
<script src="/app.js"></script>
</body>
</html>
Does component code even make sense when using SSR?
Initial idea - replacing the test here with name in specials && parser.stack.length === 1. I believe this would make <script> and <style> elements only be treated specially if they are on the top level. I don't know whether such a sweeping change is the right way to approach this.
I think that approach is good, it's how it behaves in Ractive and it seems to work okay. Was occasionally a source of confusion if you left a preceding element open (since the component script becomes a regular script) but since the parser is now quite strict about that sort of thing it shouldn't be an issue.
Does component code even make sense when using SSR?
Definitely – without it you can't do this sort of thing:
<body>
<main><App/></main>
<script src='bundle.js'></script>
</body>
Released 1.10.2 with the update: https://svelte.technology/repl/?version=1.10.2&gist=9cfc92380e52f775ca45024146435a47
Most helpful comment
I think that approach is good, it's how it behaves in Ractive and it seems to work okay. Was occasionally a source of confusion if you left a preceding element open (since the component script becomes a regular script) but since the parser is now quite strict about that sort of thing it shouldn't be an issue.
Definitely – without it you can't do this sort of thing: