You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Global styles and scripts are not injected if project path includes a junction #2726
mkdir scratch
cd scratch
ng new proj
cd ..
mklink /j scratch-link scratch # creates a junctioncd scratch\proj
ng build
The log given by the failure.
The global styles (src\styles.css) won't be injected, the resulting dist\styles.bundle.js won't have any trace of style-loader. I think the same thing will happen with global scripts, but I focused on styles.
Mention any other details that might be useful.
(Junction is one flavor of symbolic link on Windows; have not tested with other kinds. I would not be surprised if the same thing happens with symbolic or hard links on Linux, but I have not tested.)
The problem is related to the webpack configuration, specifically the include check for the global files that need to be included for style-loader/script-loader processing. The file names used to build the configuration (styles and scripts arrays) are derived from the project location and don't reflect anything about the junction. The resource names passed in by webpack for matching at runtime, however, are normalized (presumably with something like fs.realpath) and point to the original location of the files. Consequently, file names that should be selected for special processing are not matched.
It is possible that it is webpack that should process file names in the configuration in the same way it normalizes the names of the resources passed in. Or, at the CLI level, file names in the config could be normalized with fs.realpathSync. Or one can just avoid using links.
We are experiencing same. SCSS files get bundled up but it's missing the style loader modules in the styles.bundle.js. So they never get injected when running the app.
Activity
Shavindra commentedon Feb 8, 2017
We are experiencing same. SCSS files get bundled up but it's missing the style loader modules in the styles.bundle.js. So they never get injected when running the app.
fix(@angular/cli): use realpath for project root
fix(@angular/cli): use realpath for project root
fix(@angular/cli): use realpath for project root
fix(@angular/cli): use realpath for project root
fix(@angular/cli): use realpath for project root
fix(@angular/cli): use realpath for project root
angular-automatic-lock-bot commentedon Sep 7, 2019
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.
fix(@angular/cli): use realpath for project root