angular-cli.json priorty load

时间:2017-01-20 08:31:53

标签: angular angular-cli

如何为某些样式设置优先级加载。现在我可以看到样式被加载为异步,这给我带来了整个应用程序风格化的头痛。我只是想在最后加载我的gridStyle.css和style.css。

 "styles": [
        "styles.css",
        "../node_modules/primeng/resources/themes/omega/theme.css",
        "../node_modules/primeng/resources/primeng.min.css",
        "../node_modules/font-awesome/css/font-awesome.min.css",
        "../node_modules/roboto-fontface/css/roboto/roboto-fontface.css",
        "./app/shared/css/gridStyle.css",
        "./app/shared/css/spinner.css",
        "../node_modules/quill/dist/quill.core.css", 
        "../node_modules/quill/dist/quill.snow.css",
        "../node_modules/bootstrap/dist/css/bootstrap.min.css"
      ],

1 个答案:

答案 0 :(得分:2)

它们实际上是加载同步的,并且应该遵守数组中的顺序。

你可能想要:

"styles": [
    "../node_modules/primeng/resources/themes/omega/theme.css",
    "../node_modules/primeng/resources/primeng.min.css",
    "../node_modules/font-awesome/css/font-awesome.min.css",
    "../node_modules/roboto-fontface/css/roboto/roboto-fontface.css",
    "./app/shared/css/spinner.css",
    "../node_modules/quill/dist/quill.core.css", 
    "../node_modules/quill/dist/quill.snow.css",
    "../node_modules/bootstrap/dist/css/bootstrap.min.css",
    "./app/shared/css/gridStyle.css",
    "styles.css",
  ],