Avoid rewriting the module path if it starts with 'http://' or 'https://'
Currently in version 0.9.1
, if we try to use dynamic import with an external URL:
const { map, filter } = await import('https://cdn.pika.dev/async');
The module path will be rewritten to:
const { map, filter } = await import('/@modules/https://cdn.pika.dev/async');
Which causes the following errors on browser:
GET http://localhost:3000/@modules/https://cdn.pika.dev/async net::ERR_ABORTED 404 (Not Found)
TypeError: Failed to fetch dynamically imported module: http://localhost:3000/@modules/https://cdn.pika.dev/async
The simplest way to solve this is to prevent the module path from being rewritten, but it might also be interesting to proxy the request to remotely compile .vue files.
Also, vite is awesome.