简体   繁体   中英

angular-cli.json priorty load

How can I set priority loading for some styles. Right now from what I can see the styles are loaded async this gives me a headache when it comes for stylisation the entire app. I just want to load my gridStyle.css and style.css at the end.

 "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"
      ],

They are loaded sync actually, and the order you have in the array should be respected.

You probably want :

"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",
  ],

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM