Comments (3)
That did work in the minimal reproduction. However, in my local build of 5.2.0 it did not work. What did work was moving the "worker" property above the "build" property in the vite.config.js file. Clearly, the location of the property should not matter.
before:
build: {
rollupOptions: {
output: {
assetFileNames: "web/assets/[name]-[hash].[ext]",
chunkFileNames: "web/assets/[name]-[hash].[ext]",
entryFileNames: "web/assets/[name]-[hash].js"
}
}
},
worker: {
format: "es",
rollupOptions: {
output: {
entryFileNames: `web/workers/[name]-[hash].js`,
}
}
},
output:
dist/assets/myworker-dxgnPMyq.js
after
worker: {
format: "es",
rollupOptions: {
output: {
entryFileNames: `web/workers/[name]-[hash].js`,
}
}
},
build: {
rollupOptions: {
output: {
assetFileNames: "web/assets/[name]-[hash].[ext]",
chunkFileNames: "web/assets/[name]-[hash].[ext]",
entryFileNames: "web/assets/[name]-[hash].js"
}
}
},
output:
dist/web/workers/myworker-rgRqI9cd.js
from vite.
Start a new pull request in StackBlitz Codeflow.
from vite.
You need to set worker.rollupOptions.output.entryFileNames
.
https://stackblitz.com/edit/vitejs-vite-1irzjy?file=vite.config.js
from vite.
Related Issues (20)
- Unused import from external module prints massive indecipherable warning message HOT 4
- Support build multi-page-app to saparate dir HOT 1
- Dev server doesn't update overridden env var when doing an automatic reload. HOT 1
- ERR_HTTP_HEADERS_SENT with 5.3.0 / 5.3.1 and https-proxy-agent configured HOT 5
- vite build creates source folder in dist on certain imports HOT 1
- Http OPTIONS request doesn't work with Server Proxy HOT 3
- Vue3, Router4 problem when using externals
- CSS from entrypoints is not extracted correctly HOT 4
- Dynamic import of a peer dependency causes inconsistencies between dev and prod HOT 2
- Have plan to support MF2?
- Unclear configuration setup for bundling for non-browser environments HOT 7
- HMR won't work on vue files if import other packages which are in the same monorepo HOT 1
- Vite dev doesn't serve index.html from subdirectories of publicDir HOT 1
- RollupError: [type] is not exported by [file] - failure for relative imports of types HOT 2
- The page will automatically refresh after installing the plugin.prompt:optimized dependencies changed. reloading
- How to Resolve Browser Cache Invalidation Issue in Vite-React Project Deployment?
- FluentMaterial fails to compile via vite HOT 1
- JavaScript API InlineConfig Loader/Callback/Provider HOT 2
- Segmentation fault when building sveltekit library with dependency using FFI HOT 2
- Dynamic imports doesn't work after i upgraded to Vite 5.3.1 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite.