Skip to content

Commit 0af6571

Browse files
authored
Merge pull request #4058 from marshallmick007/master
angular cli with projects assets : root dir not correctly used #3864
2 parents 772847a + c92273c commit 0af6571

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

app/angular/src/server/angular-cli_config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export function getAngularCliWebpackConfigOptions(dirToSearch) {
3232
);
3333

3434
return {
35-
root: project.root,
36-
projectRoot: dirToSearch,
35+
root: dirToSearch,
36+
projectRoot: path.resolve(dirToSearch, project.root),
3737
supportES2015: false,
3838
tsConfig: {
3939
options: {},

examples/angular-cli/angular.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@
2323
"src/assets"
2424
],
2525
"styles": [
26-
"src/styles.css"
26+
"src/styles.css",
27+
"src/styles.scss"
2728
],
29+
"stylePreprocessorOptions": {
30+
"includePaths": [
31+
"src/commons"
32+
]
33+
},
2834
"scripts": []
2935
},
3036
"configurations": {
@@ -119,4 +125,4 @@
119125
}
120126
},
121127
"defaultProject": "angular-cli"
122-
}
128+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$color: green;

examples/angular-cli/src/styles.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
/* You can add global styles to this file, and also import other style files */
22

3-
.green-color {
4-
color: green;
5-
}
6-
73
.css-rules-warning {
84
display: none;
95
}

examples/angular-cli/src/styles.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* You can add global styles to this file, and also import other style files */
2+
3+
// should work because of the stylePreprocessorOptions in angular.json
4+
@import '_colors';
5+
6+
.green-color {
7+
color: $color;
8+
}

0 commit comments

Comments
 (0)