-
Notifications
You must be signed in to change notification settings - Fork 12k
No styles.css file or docs unclear about global styles #1780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From my understanding static files should go under public folder. When you do ng build it will get copied over to .\dist (I'm using angular-cli@webpack) |
I can put a .css file in the public folder and link it in the index.html but I don't believe I can get a global .scss file working that way. |
+1 |
I found this article about including global css with webpack and angular 2. However I don't know how to configure webpack with angular cli. Does anyone know how to do it ? |
+1 It's unclear how to use styles.scss for global styles (and potentially importing 3rd party scss) on 1.0.0-beta.11-webpack.2. I believe the article posted by @iwoogy applies to the previous version of the CLI used with webpack, the webpack version doesn't seem to allow configuration of the webpack build like that. EDIT: |
@iwoogy Here is how you auto update to webpack https://github.com/angular/angular-cli/blob/master/WEBPACK_UPDATE.md |
@keithmichelson Thanks for the link. I actually create my project with : I never tried the content of this article : However if there is a way to configure webpack it would be worth trying. Since it does not seem to be a clear documentation on how to configure webpack for now, I will use node-sass to compile to the public folder. The ultimate goal I'd like to achieve would be to have the same features that I have setup for my angular 1 projects about global css embedding :
|
The readme is in a bit of a bad place right now: we're adding functionality for webpack but haven't cut a release in a week or so and a lot has changed. The Meanwhile you can use the master build as described in https://github.com/angular/angular-cli#development-hints-for-hacking-on-angular-cli, but I understand that's a bit of a hassle so my advice for global styles is to wait for the next webpack release. |
@filipesilva Ahh, okay thanks for clearing this all up. Glad you are aware of it all, does that include global .scss as well? I can wait a bit, but hopefully not too long :) Thanks for the work on this, it will be really nice to use. |
Yeah you can use global css/sass/less/stylus, it should just work. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Mac OSX El Capitan
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:1.0.0-beta.11-webpack.2
do on your code? etc.
Build a new project with ng new filename --style=scss
The readme talks about a styles.css but there is no styles.css or styles.scss file for global styles created. If I need to create one manually I'm not sure where to do it or how it needs to be wired up to be included in the webpack bundle.
The text was updated successfully, but these errors were encountered: