Importing CSS and controlling order in <head> using jspm and system.js

前端 未结 4 666
夕颜
夕颜 2021-02-08 12:14

I\'ve written the following in an Aurelia app

import \"bootstrap/css/bootstrap.css!\";
import \"./app.css!\";

and I want app.css second in sin

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-08 12:56

    You could try to import the css using System.import. E.g. in your index.html:

    System.import('bootstrap/css/bootstrap.css!').then(() => {
        System.import('./app.css!');
    });
    

    But keep in mind that this way you have to make sure that system.js is served with your app. So you can't bundle your whole app as an self-executing bundle.

提交回复
热议问题