angular2-cli gives @multi styles error
Add ../ before path.
In angular-cli.json,
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.scss"
]
Update
In angular7, there is angular.json file and you do not need to add ../ before path
Angular 2 Cli Issue while ng build --prod but if I use ng build only then it work's fine but size of app is too large
Based on the error message, I can assume that you forgot to use square brackets in the styles property either in .angular-cli.json or in one of your components.
When you run ng build --prod, it performs AOT by default. As per my experience, AOT compiler catches more errors than JiT. Try this experiment - turn off the AoT during the prod build:
ng build -prod -aot=false
Most likely you won't see any errors.
Angular.json Styles and Scripts doesn't work
Don't use the physical path, add relative path.
Try like this:
"styles": [
"./node_modules/bootstrap/dist/css/bootstrap.css"
],
"scripts": [
"./node_modules/jquery/dist/jquery.js",
"./node_modules/bootstrap/dist/js/bootstrap.js",
]
angular2 - bootstrap-sass compilation error using angular-cli
After going through some research, I found solution here.
https://github.com/angular/angular-cli/issues/2170
I must set the icon path for glyphicons before importing bootstrap sass files. ie.
$icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/';
// Import bootstrap
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
Related Topics
Where to Put CSS3 Media Queries
Compass Font-Face Outputs Wrong Path to Font File
Is There a CSS Selector to Match a Option Value of The Select Tag
CSS Flexbox Width 100% Firefox
Hovered Element to Overflow Out from an Overflow:Hidden Element CSS
Dynamic HTML Table with Fixed Header and Fixed First Column
How to Create a Sprite from a Folder with and Without Background-Size (Using Compass)
CSS Transform Not Working in Ie 8
I Am Gettiing an Error Expected New Line While Compiling Sass
Install Foundation 5 in Ember-Cli
Apply CSS Properties When Transition Ends
Font Family Open Sans Not Being Used
How to Style Nested Elements in React with Styled-Components