1fe01290c0
Co-authored-by: aklinker1 <aklinker1@users.noreply.github.com>
757 B
757 B
Hooks
WXT includes a system that lets you hook into the build process and make changes.
Here's an example hook that modifies the manifest.json file before it is written to the output directory:
// wxt.config.ts
export default defineConfig({
hooks: {
'build:manifestGenerated': (wxt, manifest) => {
if (wxt.config.mode === 'development') {
manifest.title += ' (DEV)';
}
},
},
});
Most hooks provide the
wxtobject as the first argument. It contains the resolved config and other info about the current build.
Putting one-off hooks like this in your config file is simple, but if you find yourself writing lots of hooks, you should extract them into WXT Modules instead.