I'm a beginner in Angular 4 and I'm trying to export my styles as a css
file.
Whenever I serve or build the project, it generates a style.bundle.js
file and includes the css as an html style element. However, I would like to export it as a stylesheet file and load it using a link
element.
This is my Angular-cli.json :
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "ares"
},
"apps": [
{
"name":"desktop",
"root": "src",
"outDir": "dist/desktop",
"assets": [
"assets",
"favicon.ico",
"views/desktop"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"../node_modules/materialize-css/dist/css/materialize.css",
"../node_modules/font-awesome/css/font-awesome.css",
"assets/desktop/css/styles.scss",
"views/desktop/trader/first/assets/css/theme.scss"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/hammerjs/hammer.js",
"../node_modules/materialize-css/dist/js/materialize.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {}
}
}