Skip to content

Introduce possibility to disable global scripts #488

@capraruioan

Description

@capraruioan

🆒 Your use case

We have some routes that only renders the header or footer of the website.
For those routes we have the following config

routeRules: {
    '/partners/**': {
        noScripts: true,
    },
}

We only want static html on those routes and it seems that nuxt-scripts loads gtm on those pages

scripts: {
    registry: {
      googleTagManager: true,
    },
  },

🆕 The solution you'd like

a routeRules option to disable scripts loading on specific routes

🔍 Alternatives you've considered

load scripts with useScript inside the layout (because those /partners routes use a different layout)

ℹ️ Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions