-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Regression in plugin-vue 1.8 can't import const enum #5795
Comments
This is caused by this change. |
@sapphi-red thanks for debugging this! Hopefully that can lead to a fix. |
I tested with my project and can confirm @sapphi-red is right, this is the culprit here. |
Partial revert of 93d9a2d When building, TS scripts must not be inlined so that loaders (e.g. rollup-plugin-typescript2) are correctly applied. Fixes vitejs#5044, vitejs#5795, vitejs#7908
Fixed by #7909 |
Describe the bug
My project uses Typescript
const enum
.During dev, it goes through esbuild and they are handled like regular enums, no problem.
When building for prod, I have tweaked my vite config to use
tsc
compiler, so const enums actually work as they should (they're replaced by constants).This was all fine until
plugin-vue
version1.7.0
.After upgrading to
1.8.0
my build fails with an error that says "ImportedEnum
is not exported byModuleThatExportsEnum
".Reproduction
vite.config.js
that uses TS to build for prod:All you need now is an exported const enum, e.g.
enums.ts
:And a vue file that consumes it, e.g.
test.vue
:If you run
vite build
withplugin-vue >= 1.8.0
it will fail.System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: