-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Support loading ES Modules #304
Conversation
resolves some test errors
it seems that this change aim to but while our |
AFAIK that's something that typescript loader will take care of. @d-fischer can you confirm? |
it seems has a bug here const loadJs: LoaderAsync = async function loadJs(filepath) {
try {
const { href } = pathToFileURL(filepath);
return (await import(href)).default;
} catch (error) {
return loadJsSync(filepath, null);
}
}; if we have named export here it will always return maybe it should be changed to const { href } = pathToFileURL(filepath);
const moduleData = await import(href);
return moduleData.default.|| moduleData; consider below case consider below example
`valid.config.js`
```ts
import { defineConfig } from 'vite';
// it is `esm` module causeof type:`module`
export const test = defineConfig({
cake: 'a lie',
}); it will aways return me undefined.
|
Please don't crosspost your issues. Continued in #308. |
Continuation of #283