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
I am trying to import a typescript file with ?url in my application.
I would like to get the file back with already stripped types (so as a js file). This is what happens in dev mode. In production mode, the file is left untouched and I get the raw typescript source.
The documentation is not very clear about what should happen, but I would argue, that this missmatch is a bug.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
I am trying to import a typescript file with ?url in my application.
I would like to get the file back with already stripped types (so as a js file). This is what happens in dev mode. In production mode, the file is left untouched and I get the raw typescript source.
The documentation is not very clear about what should happen, but I would argue, that this missmatch is a bug.
Reproduction
https://stackblitz.com/edit/vitejs-vite-rdougd?file=main.js,test.ts&terminal=dev
Steps to reproduce
npm dev
to get the typescript compiled to js.npm build && npm preview
to get the typescript in its raw formSystem Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 18.18.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm npmPackages: vite: ^5.2.11 => 5.2.11
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: