How can I include the mode in the output folder ? #820
-
Hello, I migrated from plasmo to wxt and I'm very happy with the move! Though I miss a small thing from plasmo, which the ability to include both browser and "mode" in the output folder Our company is selling a browser extension that should be built for both edge and chrome (as of today, the list may expand over time) and we are distributing both the PROD version and the DEV version (for testers, ...). The current behavior of wxt is to generate the result inside In our release process, we can generate all combinations (edge/prod, edge/dev, chrome/prod, chrome/dev) at once. Because the mode isn't part of the output folder, the prod and dev build are overlapping. I would like to be able to emit the build inside Is there any way to do this? Should it be possible to replace the Or should it be possible to add cli arguments that may overwrite some parameters? FYI, I worked around the issue by scripting what I need. I have a build script that will generate all the combinations of supported browser / mode and call the WXT build or zip API. After each build, I can "move" the output to the desired location. It's working, but required a bit of plumbing. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
More than just command line arguments, defineConfig should support functions, like vite.config.ts: // This could even be the async function
export default defineConfig(({ command, mode }) => {
return {
// vite config
}
}) |
Beta Was this translation helpful? Give feedback.
-
For now, you can change the output directory using a module: // modules/out-dir.ts
export default defineWxtModule((wxt) => {
wxt.hooks.hook('ready', (wxt) => {
wxt.config.outDir += `-${WXT.config.mode}`
});
}); |
Beta Was this translation helpful? Give feedback.
For now, you can change the output directory using a module: