Closed geoidesic closed 3 weeks ago
https://github.com/Pjb518/FoundryVTT-Level-Up-Official/blob/main/vite.config.js
tldr
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
if (assetInfo.name === "style.css") {
return `${moduleJSON.id}.css`
}
return (assetInfo.name as string)
},
},
},
plugins: [
...
{
name: 'change-names',
configureServer(server) {
server.middlewares.use((req: Connect.IncomingMessage & { url?: string }, res, next) => {
if (req.originalUrl?.includes(`/${packagePath}/`)) {
if (req.originalUrl === `/${packagePath}/dist/${moduleJSON.id}.js`) {
req.url = `/${packagePath}/dist/index.js`
}
}
next()
})
},
},
(vite doesn't seem to have an option to rename the index.js file to anything else while in dev mode, so plugin it is)
This is now working
THIS IS STUPID Image Image Vauxs — 06/11/2024 10:04 PM Image yet it works geoidesic — 06/11/2024 10:13 PM So you created an import proxy? 😅 Now why didn't I think of that?