Vite doesn't build typescript that imported with `?url`

Viewed 156

I'm creating an audio application with vite and typescript. I imported my audio worklet like this:

import AudioMixerWorkletUrl from "./AudioMixerWorklet.ts?url";
context.audioWorklet.addModule(url);
const node = new AudioWorkletNode(context, name);
// ...

It works with developement server. But doesn't work with production build. The AudioMixerWorklet.ts was copied to assest folder without converting to Javascript!

How can I solve this problem?

0 Answers
Related