node.js - נתיבים יחסיים בקבצי scss
יש לי כמה נתיבים יחסיים בקובץ SCSS שלי, לדוגמה:
&.id-1 {
background-image: url("./assets/images/live-sports/icon-soccer.svg");
}
ובקשר לאלמנט השני יש לי את הנתיב URL הזה
&.id-1 {
-webkit-mask-image: url("./assets/images/live-sports/terminal/icon-soccer.svg");
}
באופציות הבנייה ב-angular.json שלי עבור הפרויקט הזה זה נראה כך:
"options": {
"outputPath": "dist/AppLiveConference",
"resourcesOutputPath": "resources",
"index": "projects/AppLiveConference/src/index.html",
"main": "projects/AppLiveConference/src/main.ts",
"polyfills": "projects/AppLiveConference/src/polyfills.ts",
"tsConfig": "projects/AppLiveConference/tsconfig.app.json",
"aot": false,
"assets": [
"projects/AppLiveConference/src/favicon.ico",
"projects/AppLiveConference/src/assets"
],
"styles": [
"projects/AppLiveConference/src/styles.scss"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js"
]
}
הבעיה היא שה-angular-cli מתעלם מתתי-תיקיות ושם את כל קבצי המשאבים בתיקיית resources ו-"icon-soccer.svg" נכתבים אחד על השני. איך אפשר לתקן את זה?
גרסת angular-cli: 8.1.3
תשובה #1
ה-URL שלך שגוי, אתה צריך להסיר אותו
"options": {
"outputPath": "dist/AppLiveConference",
"resourcesOutputPath": "resources",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js"
]
}
