Closed haakonjackfloat closed 4 months ago
I realize now that the issue is because Vite plugins are not automatically applied to Web-Workers.
Resolved the issue by updating vite.config
with:
{
worker: {
plugins: [
tsconfigPaths(),
],
},
}
Given a directory structure:
and a TS alias configured so that
@app
points to the top levelapp
directory.Say
workerModule
is a WebWorker which is imported with theworkerModule?worker
syntax, andworkerModule
has an import like so:Vite will give an error like:
The error will be resolved if we change the import like so:
Versions:
vite@5.3.3 vite-tsconfig-paths@4.3.2