nuxt-modules / partytown

Partytown integration for Nuxt. Run third-party scripts from a web worker.
MIT License
318 stars 8 forks source link

Rewrite nuxt config in runtime #250

Open oleghalin opened 1 year ago

oleghalin commented 1 year ago

Plugin works like a charm, but for supporting GTM debug i need to stop pushing gtm to partytown if debug enabled which i made based on query parameter, but also i need to stop forwarding dataLayer.push to partytown if debug enabled, what will be proper way to change nuxt config in middleware or plugin?

Thanks

oleghalin commented 1 year ago

So, i figured it out with plugin which rewrites window.partytown on runtime, but i think its better to move generating partytown config to runtime, what you think about it? Maybe some sort of definePartytown composable?