【问题标题】:Shopware 6 Using fontawesome in custom themeShopware 6 在自定义主题中使用 fontawesome
【发布时间】:2022-07-08 13:56:22
【问题描述】:

我需要在我的自定义主题中使用 fontawesome。 因此我使用 yarn yarn add @fortawesome/fontawesome-free 安装了它

当我尝试在主题的 base.scss 中导入它 (@import "~@fortawesome") 时,出现以下错误:

在 ThemeCompiler.php 第 317 行:
[Shopware\Storefront\Theme\Exception\ThemeCompileException]
无法编译主题“CustomTheme”。 @import 找不到~@fortawesome 文件:custom/plugins/CustomTheme/src/Resources/app/storefront/src/scss/base.scss 第 2 行第 1 列
调用堆栈:
#0 在第 409 行导入 custom/plugins/CustomTheme/src/Resources/app/storefront/src/scss/base.scss(未知文件)

谁能告诉我如何将 fa 正确导入我的 scss 文件?

【问题讨论】:

    标签: shopware shopware6


    【解决方案1】:

    实际上 Shopware 使用的是npm,而不是yarn

    所以请使用npm install @fortawesome/fontawesome-free

    确保您在主题文件夹中执行npm install

    在构建店面时,Shopware iterates over the themes/plugins and installs dependencies 应该可用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-12
      • 2023-01-20
      • 2023-01-20
      • 2023-01-13
      • 2021-12-22
      • 1970-01-01
      • 1970-01-01
      • 2020-10-30
      相关资源
      最近更新 更多