如何安装 Sass 作为 Composer 的依赖项?
How to install Sass as a dependency with Composer?
我正在使用 Composer 作为 WordPress 项目的依赖项管理器。我在 composer.json 中将插件和 WP-CLI 指定为依赖项,如下所示:
"require": {
"johnpbloch/wordpress": "5.8.*",
"wp-cli/wp-cli-bundle": "*",
"wpackagist-plugin/akismet": "*"
}
这是 documentation on installing WP CLI via Composer. This works great. However, I would also like to include the latest version of SASS 这种方式,这样项目的新人就可以通过 Composer 安装它,而无需手动安装。
我不能指望每个人都有 npm、Chocolatey 或 Homebrew,而且我不知道他们使用什么操作系统。
或者,我如何通过 a script that Composer runs using post-install-cmd 安装最新版本的 SASS cross-OS?
如果没有 Sass 的包(并且没有包是有道理的,除非 sass 可以安装为 stand-alone 二进制文件或类似的东西),你不能安装 Sass 作为 composer 依赖项
这在任何情况下都没有多大意义,因为 Sass 不能成为 PHP 项目的依赖项,因为它与 PHP 无关。
Alternately, how could I install the latest version of SASS cross-OS via a script that Composer runs using post-install-cmd?
install instructions for Sass 没有提供“不使用 npm 的交叉 OS 安装程序”。因此,除非您编写一个脚本来检查 OS、它安装了什么等(这会很脆弱并且有些 严重 矫枉过正),您不能使用 post-install-cmd
.
再一次,在任何情况下都没有多大意义。如果包使用者需要使用项目的 sass 部分,则假定他们是开发人员并且能够满足 sass 要求。
将您的包消费者指向适当的文档并完成。
我正在使用 Composer 作为 WordPress 项目的依赖项管理器。我在 composer.json 中将插件和 WP-CLI 指定为依赖项,如下所示:
"require": {
"johnpbloch/wordpress": "5.8.*",
"wp-cli/wp-cli-bundle": "*",
"wpackagist-plugin/akismet": "*"
}
这是 documentation on installing WP CLI via Composer. This works great. However, I would also like to include the latest version of SASS 这种方式,这样项目的新人就可以通过 Composer 安装它,而无需手动安装。
我不能指望每个人都有 npm、Chocolatey 或 Homebrew,而且我不知道他们使用什么操作系统。
或者,我如何通过 a script that Composer runs using post-install-cmd 安装最新版本的 SASS cross-OS?
如果没有 Sass 的包(并且没有包是有道理的,除非 sass 可以安装为 stand-alone 二进制文件或类似的东西),你不能安装 Sass 作为 composer 依赖项
这在任何情况下都没有多大意义,因为 Sass 不能成为 PHP 项目的依赖项,因为它与 PHP 无关。
Alternately, how could I install the latest version of SASS cross-OS via a script that Composer runs using post-install-cmd?
install instructions for Sass 没有提供“不使用 npm 的交叉 OS 安装程序”。因此,除非您编写一个脚本来检查 OS、它安装了什么等(这会很脆弱并且有些 严重 矫枉过正),您不能使用 post-install-cmd
.
再一次,在任何情况下都没有多大意义。如果包使用者需要使用项目的 sass 部分,则假定他们是开发人员并且能够满足 sass 要求。
将您的包消费者指向适当的文档并完成。