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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the behavior of plugins configuration #59

Closed
wants to merge 1 commit into from

Conversation

median-dxz
Copy link

@median-dxz median-dxz commented Mar 13, 2021

I have viewed hexojs/hexo#4619 (comment)
So I know the nib's repo use stylus v0.54.8 but it haven't been published.
To remove the annoying warnings, I think users could disable nib in this renderer by using configuration like this if they don't need it :

stylus:
  plugins: ''

can it be applied to this renderer plugin?

@tomap
Copy link
Contributor

tomap commented Mar 14, 2021

With that change, you would be disabling nib by default. Not sure we want that. If we do, we would need to publish a new major version (breaking change)

@median-dxz
Copy link
Author

median-dxz commented Mar 14, 2021

With that change, you would be disabling nib by default. Not sure we want that. If we do, we would need to publish a new major version (breaking change)

I know we shouldn't change the default behavior, but it seems that the code isn't work well..
My thought is only when users set plugins: '' can they disable nib, otherwise nib will still be using in other situation.

@tomap Thank you for replying that.

@median-dxz
Copy link
Author

median-dxz commented Mar 14, 2021

Sorry for my mistake that the code in the previous PR not work with the behavior I expect.

It should be in the way like this:

- const plugins = ['nib'].concat(config.plugins || []);
+ const plugins = config.plugins ? ['nib'].concat(config.plugins) : (config.plugins === '' ? [] : ['nib']);

So, is that feature can be appiled?
I am a Chinese, and my English may be not properly enough. Sorry for that.

@stevenjoezhang
Copy link
Member

This problem is a bit tricky, because removing the nib plugin will break some old themes that depend on it. Maybe we need to start the migration work from the Hexo default theme landscape first, and tell the theme developers to avoid dependence on nib in the stylus file

See also stylus/nib#348 (comment)

@iChenLei iChenLei mentioned this pull request May 17, 2022
@stevenjoezhang stevenjoezhang mentioned this pull request May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants