29 November 2021

Bundle CSS Angular 2+

 

angular.json
2021
"build": {
  "builder": "@angular-devkit/build-angular:browser",
  "options": {
    "styles": [
      {
        "input": "src/style/dark/dark.scss",
        "lazy": true,
        "bundleName": "assets/dark"
      },
      {
        "input": "src/style/light/light.scss",
        "lazy": true,
        "bundleName": "assets/light"
      }
    ]
  }
index.html
2021

<link href='assets/dark.css' rel='stylesheet' title="Dark" disabled/>
<link href='assets/light.css' rel='stylesheet' title="Light" />


0 nhận xét:

Post a Comment

 

BACK TO TOP

Xuống cuối trang