我使用角v6.1.2和刚开始后的初始项目公会。然后我在链接https://www.npmjs.com/package/material-components-web之后添加MDC,
然后,在我的styles.scss文件项目中,我只需要像这样导入MDC
@import "~material-components-web/material-components-web";然后我运行应用程序,它显示了这个错误。
模块构建失败:@import“@failed/ to /mdc-按钮”;^ File to导入,未找到或无法读取:@failed/to/mdc-按钮。等等..。
我尝试在angular.json中添加一条路径,就像下面的代码一样,但是它不起作用。
"stylePreprocessorOptions": {
"includePaths": [
"./node_modules/material-components-web", "./node_modules/@material"
]
}还有什么我错过的吗?
发布于 2018-08-18 13:31:19
"stylePreprocessorOptions": {
"includePaths": [
"./node_modules"
]
}只需包含在node_modules路径上,因为material-components-web和@material需要知道父路径。
https://stackoverflow.com/questions/51863023
复制相似问题