Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Illegal Module Name" for external URL #191

Closed
chowey opened this issue Jun 21, 2020 · 1 comment
Closed

"Illegal Module Name" for external URL #191

chowey opened this issue Jun 21, 2020 · 1 comment

Comments

@chowey
Copy link

chowey commented Jun 21, 2020

I have a source file with an external import, like so:

// source.js
import config from "/api/config?a=1&b=2";
// do some stuff with config

I try to build it with the --bundle and --external:"/api/config?a=1&b=2" flags. I get the following error:

error: Invalid module name: "/api/config?a=1&b=2"

This does work with other build systems (e.g. TypeScript or Babel). The external module is supposed to be resolved by the browser at runtime.

Am I doing something wrong? Is this not supported?

@evanw
Copy link
Owner

evanw commented Jun 22, 2020

Right now the --external flag is only for excluding modules, not arbitrary paths. There is already an open feature request for having --external support relative paths: #127. It looks like this request is similar but slightly different because it's for absolute paths, not relative paths.

@evanw evanw closed this as completed in 66fb3f5 Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants