3rd party libs not being pulled into global css or js
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Mac OSX El Capitan
- Versions. Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
$ ng --version
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.11-webpack.2
node: 4.2.2
os: darwin x64
$
- Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
- Create new project with angular-cli@webpack
- The log given by the failure. Normally this include a stack trace and some more information. no errors are output
- Mention any other details that might be useful.
{
"project": {
"version": "1.0.0-beta.11-webpack.2",
"name": "ready-med"
},
"apps": [
{
"main": "src/main.ts",
"tsconfig": "src/tsconfig.json",
"mobile": false,
"styles" : [
"styles.scss",
"../node_modules/bootstrap/dist/css/bootstrap.css"
],
"scripts" : [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/tether/dist/js/tether.js",
"../node_modules/bootstrap/dist/js/bootstrap.js"
]
}
],
"addons": [],
"packages": [],
"e2e": {
"protractor": {
"config": "config/protractor.conf.js"
}
},
"test": {
"karma": {
"config": "config/karma.conf.js"
}
},
"defaults": {
"prefix": "app",
"sourceDir": "src",
"styleExt": "scss",
"prefixInterfaces": false,
"lazyRoutePrefix": "+"
}
}
Thanks! We'll be in touch soon.
update angular-cli this issue is fixed in 1.0.0-beta.11-webpack.8
Updating resolved the issue
Thank you!
It isn't working for me using latest update. At least bootstrap isn't. I will check again tomorrow but I am pretty sure I used latest version and performed same steps op did. I used npm version of bootstrap.
@jaimehrubiks double-check paths, I lost a lot of time before I noticed that I had mine wrong paths in global scripts and styles are relative to your apps[0].root directory
unfortunately, angular-cli doesn't give any error/warning if it cannot find specified files
What OS do you use? Yesterday, I also noticed something strange in term of using angular-cli.
On Windows 7, I used a cli config file like you (in terms of the bootstrap path in the styles property) and worked fine. If I use the exact same file in a linux environment, it didn't worked. The build was succesfull, but the css file was not included in the bundle. What I did is that I placed the bootstrap path as an import in the global styles.css like below: @import '../node_modules/bootstrap/dist/css/bootstrap.css';
After this change, it worked fine on both environments, so it seems to be that there is some different behaviour in terms of OS. I am also not sure what the difference is between the property styles and the global styles.css. Should external stylesheets from a different package be loaded using the global styles.css, using the cli config file or both should be supported?
global styles.css file is meant for your custom css that you want applied to the whole application
styles in apps[0].styles are third-party styles that you want to load
@jaimehrubiks try generating a new project with ng new
Then verify that the angular-cli.json have webpack 8 in the version.
It is working.
My problem seems to be related to bootstrap, somehow it does not work correctly when following the guide on this repo (on osx). But I downloaded it manually (instead of npm) and put it on assets folder and linked on styles[0] and it works perfect.
This functionality was only present starting 1.0.0-beta.11-webpack.8. The current latest 1.0.0-beta.14 also fully supports this.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.