support custom JavaScript formats #226
thescientist13
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
It would be nice to support importing things that are not just javascript, e.g.
But also need to make sure it won't break / yell if something non JS compatible was added and sent to acorn
Details
This is because right now we limit what can be passed to WCC, otherwise acorn will fail on things that are not ultimately transformed into JavaScript, e.g.
Details
registerDeps { moduleURL: URL { href: 'file:///Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/plugin-typescript/test/cases/exp-prerender.serve.ssr/src/components/card/card.ts', origin: 'null', protocol: 'file:', username: '', password: '', host: '', hostname: '', port: '', pathname: '/Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/plugin-typescript/test/cases/exp-prerender.serve.ssr/src/components/card/card.ts', search: '', searchParams: URLSearchParams {}, hash: '' } }
While the above outcome may seem expected, for frameworks like Greenwood that support custom imports, the use of
fshere totally bypasses the ESM loader mechanics, which means if you have a custom loader for handling TypeScript, it will never run, thus WCC will always just be reading the unprocessed source contents.Beta Was this translation helpful? Give feedback.
All reactions