如何在 MeteorJS 中使用材质组件 Web sass



我想在我的 meteor 应用程序中使用Web 材质设计组件。不幸的是,当像这样从 npm 包导入 mdc 时:

@import "{}/node_modules/material-components-web/material-components-web";

我收到以下错误:

While processing files with fourseven:scss (for target web.browser):
/client/stylesheets/Application.scss: Scss compiler error: File to import: @material/animation/mdc-animation not found in
file: {}/node_modules/material-components-web/material-components-web.scss

我想这是由于 mdc 的结构。material-components-web.scss文件导入所有单个组件,这些组件位于node_modules/@material中,而不是在node_modules/material-components-web内。

我正在使用fourseven:scss包在我的流星应用程序中编译 sass。

如何解决/修复此问题?

正如我在github上的问题中所写的:

您需要创建一个 scss-config.json 文件,如下所述:https://github.com/fourseven/meteor-scss#global-include-path

该文件的内容将是:

{
"includePaths": [
"{}/node_modules/"
]
}

最新更新