Skip to content

equivalent of inline module in HTML? Consider "System.execute" to register and execute immediately? #2148

@csr632

Description

@csr632

I want to inline the first module in my html, to reduce loading time. So instead of this:

<script src="system.js"></script>
<script>System.import('/js/main.js')</script>

I want to do something equivalent to this:

<script type="module">
  // This is main.js module
  import {addTextToBody} from './utils.mjs';
  addTextToBody('Modules are pretty cool.');
</script>

Update: Clarify: In this example, when I said ./utils.mjs, I actually want to say shared-utils, which is an external dependency(matained and deployed by other team).

How to achieve this with systemjs module?

Update: my proposol is in this comment: #2148 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions