Angular SSR-找不到导入文件或不可读:

时间:2019-03-10 19:45:08

标签: angular angular-universal ssr

在我的angular.json > projects > landing > architect > built > options中,我有:

"stylePreprocessorOptions": {
  "includePaths": [
    "src/theme/mixins"
  ]
},

这让我以组件的样式导入样式,例如:

@import "breakpoints"; // instead of ../../../../theme/mixins/breakpoints

当我要为server构建应用程序时,问题就开始了。由于无法将stylePreprocessorOptions添加到架构师为服务器构建的选项中,因此出现以下错误:

ERROR in Module build failed (from ./node_modules/sass-loader/lib/loader.js):

@import "breakpoints";
^
      File to import not found or unreadable: breakpoints.

当我尝试将stylePreprocessorOptions添加到server体系结构时,出现以下错误:

Schema validation failed with the following errors:
  Data path "['server']" should NOT have additional properties(stylePreprocessorOptions).
Error: Schema validation failed with the following errors:
  Data path "['server']" should NOT have additional properties(stylePreprocessorOptions).

在相对更改路径的同时,它可以起作用:

@import "../../../../theme/mixins/breakpoints";

有解决方案吗?

0 个答案:

没有答案