You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the code above is not going to increase the overall file size, it is good to be able to dedupe such code in a separate bundle and import when needed in each and every compiled TS file that requires it.
Reproduction
Run npm init @vitejs/app and select lit-element-ts to scaffold a project
Ensure vite is always the latest version
Create a simple my-app using lit-element and render my-app inside my-element
Run npm run dev to start the dev server
Access the local dev server and inspect the compiled scripts in the Network tab in Chrome DevTool or equivalent
The said generated code will be inside each and every compiled TS file
System Info
vite version: 2.0.0-beta.61
Operating System: Windows 10 x64
Node version: 15.7.0
Package manager (npm/yarn/pnpm) and version: npm@7.4.3
Logs (Optional if provided reproduction)
Run vite or vite build with the --debug flag.
Provide the error log here.
The text was updated successfully, but these errors were encountered:
This is a limitation because esbuild transpiles TS modules in insolation. I'm not sure if esbuild has an equivalent of TS' importHelpers for this. /cc @evanw
You may try vite-plugin-ts, which uses the official TS package to compile .ts(x) files, and support importHelpers, decorator, const enum, emitMetadata, etc.
Describe the bug
The following code is embedded in each compiled TypeScript file when decorator is used.
While the code above is not going to increase the overall file size, it is good to be able to dedupe such code in a separate bundle and import when needed in each and every compiled TS file that requires it.
Reproduction
npm init @vitejs/app
and selectlit-element-ts
to scaffold a projectvite
is always the latest versionmy-app
usinglit-element
and rendermy-app
insidemy-element
npm run dev
to start the dev serverSystem Info
vite
version: 2.0.0-beta.61npm@7.4.3
Logs (Optional if provided reproduction)
vite
orvite build
with the--debug
flag.The text was updated successfully, but these errors were encountered: