简体   繁体   English

Angular 11 css 在 node_modules 文件夹被符号链接时不起作用

[英]Angular 11 css is not working when node_modules folder is symlinked

I am working on several Angular projects which has same node_folder (with same node dependencies), so i made a symlink to new second angular project, it compiles successfully, but CSS is not working.我正在处理几个 Angular 项目,这些项目具有相同的 node_folder(具有相同的节点依赖项),所以我创建了一个指向新的第二个 angular 项目的符号链接,它编译成功,但 Z2C56C360580420D58DF172FEDZ2 不工作。

later i removed the symlink and modified the angular.json with "../node_modules/.." pointing to node_modules folder which is on same level as project folder后来我删除了符号链接并修改了 angular.json 与“../node_modules/..”指向与项目文件夹处于同一级别的node_modules文件夹

  • ../ ../
  • ./ ./
  • /node_modules /node_modules
  • /project1 /项目1
  • /project2 /项目2

etc ETC

still the project gets compiled, yet CSS is not working - is it possible to fix this and get CSS working with this way?项目仍在编译,但 CSS 无法正常工作 - 是否可以解决此问题并让 CSS 以这种方式工作?

Adding NODE_PATH pointing to node_modules folder and modifying the angular.json accordingly solved the problem添加指向 node_modules 文件夹的 NODE_PATH 并相应地修改 angular.json 解决了问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用angular cli从node_modules文件夹添加CSS - Add the CSS from the node_modules folder using angular cli 如何在Angular 5的node_modules文件夹中删除不需要的文件 - How to remove unwanted files in node_modules folder Angular 5 包括在Webpack生产中不起作用的node_modules css文件 - Including node_modules css files not working in Webpack production 引用node_modules文件夹中的资源 - Referencing resources in node_modules folder 使用〜从Angular的使用合同的node_modules中导入带有Angular的CSS吗? - Is using ~ to import CSS with Angular from node_modules part of Angular's usage contract? 使用 Parcel 从 node_modules 导入 CSS - Importing CSS from node_modules with Parcel 如何从webpack angular2 app中的node_modules导入CSS - How to import CSS from node_modules in webpack angular2 app 在 netlify css ./node_modules/gatsby/node_modules/css-loader 上部署失败 - Deploy failed on netlify css ./node_modules/gatsby/node_modules/css-loader Postcss-扩大。 从node_modules文件夹@import文件时“找不到类”? - Postcss-extend. 'class not found' when file is @imported from node_modules folder? 如何处理依赖于.css文件的node_modules内部的模块? - How to deal with modules inside node_modules that depends .css files?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM