gared/polyless
Composer 安装命令:
composer require gared/polyless
包简介
Composer plugin that removes unnecessary Symfony polyfill packages
README 文档
README
polyless is a Composer plugin that marks unnecessary symfony/polyfill-* packages as replaced by the root project and removes their package candidates from Composer's pool.
What it does
The current basic implementation disables polyfills when one of these conditions is true:
- the project's PHP constraint guarantees a version that already contains the feature set of a
symfony/polyfill-phpXYpackage - the root project explicitly requires the corresponding extension, for example
ext-mbstringforsymfony/polyfill-mbstring config.platform.phpor configuredext-*platform entries provide the same guarantee
Direct root requirements for a specific symfony/polyfill-* package are left untouched.
Usage
Add this package to your project dev dependencies:
composer require --dev gared/polyless
You need to allow this package to run as a plugin!
After that run:
composer update symfony/polyfill-*
to remove any unnecessary polyfill packages from your project.
Current examples
PHP polyfills
If your project requires PHP 8.5:
{
"require": {
"php": "^8.5"
}
}
then the plugin can replace packages such as:
symfony/polyfill-php80symfony/polyfill-php81symfony/polyfill-php82symfony/polyfill-php83symfony/polyfill-php84symfony/polyfill-php85
If your project requires ext-intl, polyfills such as symfony/polyfill-intl-grapheme and symfony/polyfill-intl-normalizer can also be skipped.
Extension polyfills
If you composer.lock contains symfony/polyfill-mbstring you can run the following command to require the ext-mbstring extension instead (of course you need to have the PHP extension installed):
composer require ext-mbstring
this will automatically remove the symfony/polyfill-mbstring package from your project.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-27