Closed bangseongbeom closed 8 years ago
<script type="module" src="path/to/something.js"></script>
works just fine to match traditional <link>
and <script>
tags, and it is specified here: https://html.spec.whatwg.org/#resolve-a-module-specifier
As for the import statements, you should be able to do import foo from "foo";
but it will require you to define a custom @@resolve
hook that understands what "foo"
means, because the default behavior of the loader will not know what to do with it. In the other hand, other environments, like node, will have a default behavior for it, which relies on npm.
and it is specified here: https://html.spec.whatwg.org/#resolve-a-module-specifier
Not quite, that specifies how import
is processed. I believe you're looking for https://html.spec.whatwg.org/#prepare-a-script step 16.4.
:+1:
I agree that the name resolution policy may not follow the URL syntax fully, but it may confuse the users if it's invalid to start without "./" because
<link>
in HTML and@import
in CSS permit both with and without.