Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

import: URL clarification #149

@guybedford

Description

@guybedford

The readme information on import: referrer handling is really excellent, but I just wanted to clarify one case for my own peace of mind which doesn't seem to be mentioned.

If I use an import: URL in a module specifier or dynamic import, will it still be resolved relative to the parent:

import x from 'import:x';
import y from 'x';
const z = await import('import:x');

// Are x,y, z all equal?

In addition, does that mean a dynamic import in a script would be script-relative:

<script src="/path/to/script.js"></script>

script.js

import('import:./dep.js'); // loads /path/to/dep.js?

I would hope that the answer to the above would be yes for consistency, but it doesn't seem to be explicitly detailed from what I could see.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions