-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Option to disable javascript required features #110
Comments
I want this, too. Additionally, I want these plugins to tell Webpack/Parcel/etc. to automatically bundle the required JS for me when these plugins are applied. |
Big plus 1 to this. Its not always possible to force consumers to install JS polyfills when creating a library. |
@romainmenke while doing #115 thought about adding this too. However, I'm not sure if this makes sense at preset-env level or at the plugin level. On one hand, I think it's the responsibility of each plugin, on the other hand, I also think that it only makes sense at env level given that you might not even know you need to include a browser polyfill but you should if you're running the plugin in standalone mode. If so, I think this merits yet another option which should be "silent" if you don't want this nor ' pluginIdHelp` to warn. In any case, any thoughts? How could we tackle this 👇
|
I think this is best done with a very explicit API. {
"stage": 0,
"features": {},
"browsers": "",
"disableClientSidePolyfills": true
} The name might need some bikeshedding but I like this to start from the issue : "I can't or don't want to polyfill the client". Another concern is the current complexity in Maybe we can clean this up first before adding more config?
This is not possible :/ The best idea I had for this was to have plugins emit The plugins would only add the Users can then import this file where and how they like. The issue with even this basic approach is that it requires tools and users to run processes in series. PostCSS has to run fully before any JS related task can even start. Any decently optimised build script would run things in parallel or at least concurrently making this non-viable. A more complex solution would be to create plugins for each bundler. The plugins could then dynamically inject This approach is slow as CSS is processed twice. It would also be nightmarishly complex as it would need to support all combinations in this matrix :
I do not feel comfortable taking this on both in terms of complexity and for maintenance. I think we best poor our efforts in documentation and sharing knowledge and avoid any convenience magic. |
discussed with @Antonio-Laguna Idea for some next major : Disable these plugins by default and add a flag to enable them. Making this explicit will make it much more likely that people who enable them also know that the client side polyfill is required and how to add these. |
@shrpne @wesgro There is a new option For now this defaults to Since these polyfills require a manual step anyway it makes more sense to also enable them manually. This creates a simpler default setup. |
I want to disable all features which require javascript.
For now, I have to go through each plugin and check if it requires JS.
Then I have to specify each of them in the options.
It would be very helpful if:
Several other people wanting this:
csstools/postcss-preset-env#25 (comment)
csstools/postcss-preset-env#25 (comment)
The text was updated successfully, but these errors were encountered: