-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Milestone
Description
OS
Tested on both Windows 7 and Linux (Fedora 24)
Version
$ ng --version
angular-cli: 1.0.0-beta.22-1
node: 4.6.1
os: linux x64
The app was created using CLI.
Repro steps
- Install a package containing a stylesheet (say bootstrap-sass, actually any package will do) globally via npm.
- git clone https://github.com/twbs/bootstrap-sass.git into a working directory, cd to that working directory and perform
npm linkcommand. - ng new project in another separate directory, cd to the newly create project directory and perform
npm link bootstrap-sass. This will create abootstrap-sasssymlink in node_modules pointing to the local git repository. - Modify angular-cli.json to reference the stylesheet in the linked package.
"styles": [
"../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss",
"styles.scss"
],
ng serveand observe that styles from bootstrap is not exported correctly in the index page.ng buildand observe that the generated styles.bundle.js does not do "exports.push()".
The log given by the failure
There was no error log, webpack declared the "bundle is now valid".
Mention any other details that might be useful
Using normal npm install approach does not have this issue. i.e. after npm unlink bootstrap-sass && npm install bootstrap-sass then all is fine.
Use case: I have a forked gentelella repository locally to fix some of the issues I found, so I cannot just simply npm install it in my project. Using npm link approach as I outlined above should work. It seems angular-cli (or webpack, I am not sure) is being confused by symlink. As a temporary workaround, I replace the stylesheet reference in the angular-cli.json with an absolute path to the stylesheet file in the local git repo.
eviljoe, zwoolev, seangwright, scottseeker, hieuxlu and 6 more