是的,Angular - Node版本11是支持node-sass的。
要在Angular项目中使用node-sass,首先请确保已安装了node-sass。您可以在项目根目录下运行以下命令来安装node-sass:
npm install node-sass
安装完成后,您需要在项目的angular.json
文件中进行一些配置。找到以下部分:
"architect": {
"build": {
"options": {
...
"styles": [
"src/styles.scss"
],
...
}
},
...
}
然后,将"styles"
数组中的值从.css
更改为.scss
,就像这样:
"architect": {
"build": {
"options": {
...
"styles": [
"src/styles.scss"
],
...
}
},
...
}
现在,您可以在项目中使用SCSS样式了。
请注意,如果您在以前的版本中已经使用了node-sass,那么使用Angular - Node版本11时,您可能需要更新node-sass的版本。您可以运行以下命令来更新node-sass:
npm install node-sass@latest
这样就可以确保使用最新版本的node-sass。
希望这可以帮助到您!