Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow an ergonomic way to filter plugins between dev & prod. #3663

Closed
phated opened this issue Oct 30, 2020 · 1 comment 路 Fixed by #3704
Closed

Allow an ergonomic way to filter plugins between dev & prod. #3663

phated opened this issue Oct 30, 2020 · 1 comment 路 Fixed by #3704
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@phated
Copy link
Contributor

phated commented Oct 30, 2020

馃殌 Feature

Allow an ergonomic way to filter plugins between dev & prod. We were asked to open an issue about this in Discord - ref gulpjs/gulpjs.github.io#123 (comment)

Have you read the Contributing Guidelines on issues?

Yes.

Motivation

For gulp's website, we want to have a series of plugins that are only applied at production-build time (analytics, gtag, sitemap, etc).

We are currenly doing it with this code, on an old 2-alpha version:

plugins: [
    isProd && ['@docusaurus/plugin-google-analytics', {}],
    isProd && ['@docusaurus/plugin-google-gtag', {}],
    isProd && ['@docusaurus/plugin-sitemap', {}],
]

This became invalid in a more recent alpha version that we are upgrading into because those resolve to false in development.

Pitch

I think it is fairly common that people will want to have some plugins they don't want active during development (e.g. carbon-ads plugin) and they will want a concise way to filter those out.

@phated phated added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Oct 30, 2020
@slorber
Copy link
Collaborator

slorber commented Oct 31, 2020

thanks, make sense ;)

as I said on discord, some of those plugins already enable only in prod, but yeah having this conditional feature will be useful

@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
3 participants