@@ -30,15 +30,25 @@ export default function () {
30
30
@import 'variables'
31
31
h4
32
32
background-color: $primary-color
33
+ ` ,
34
+ 'src/style-paths/variables.less' : '@primary-color: #ADD;' ,
35
+ 'src/styles.less' : `
36
+ @import 'variables';
37
+ h5 { color: @primary-color; }
38
+ ` ,
39
+ 'src/app/app.component.less' : `
40
+ @import 'variables';
41
+ h6 { color: @primary-color; }
33
42
`
34
43
} ) )
35
44
. then ( ( ) => replaceInFile ( 'src/app/app.component.ts' , `'./app.component.css\'` ,
36
- `'./app.component.scss', './app.component.styl'` ) )
45
+ `'./app.component.scss', './app.component.styl', './app.component.less' ` ) )
37
46
. then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
38
47
const app = configJson [ 'apps' ] [ 0 ] ;
39
48
app [ 'styles' ] = [
40
49
'styles.scss' ,
41
- 'styles.styl'
50
+ 'styles.styl' ,
51
+ 'styles.less'
42
52
] ;
43
53
app [ 'stylePreprocessorOptions' ] = {
44
54
includePaths : [
@@ -52,9 +62,13 @@ export default function () {
52
62
. then ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' , / h 2 .* { .* c o l o r : r e d ; .* } / ) )
53
63
. then ( ( ) => expectFileToMatch ( 'dist/styles.bundle.css' , / h 3 \s * { \s * c o l o r : # 0 0 8 0 0 0 ; \s * } / ) )
54
64
. then ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' , / h 4 .* { .* c o l o r : # 0 0 8 0 0 0 ; .* } / ) )
65
+ . then ( ( ) => expectFileToMatch ( 'dist/styles.bundle.css' , / h 5 \s * { \s * c o l o r : # A D D A D D ; \s * } / ) )
66
+ . then ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' , / h 6 .* { .* c o l o r : # A D D A D D ; .* } / ) )
55
67
. then ( ( ) => ng ( 'build' , '--extract-css' , '--aot' ) )
56
68
. then ( ( ) => expectFileToMatch ( 'dist/styles.bundle.css' , / h 1 \s * { \s * c o l o r : r e d ; \s * } / ) )
57
69
. then ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' , / h 2 .* { .* c o l o r : r e d ; .* } / ) )
58
70
. then ( ( ) => expectFileToMatch ( 'dist/styles.bundle.css' , / h 3 \s * { \s * c o l o r : # 0 0 8 0 0 0 ; \s * } / ) )
59
- . then ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' , / h 4 .* { .* c o l o r : # 0 0 8 0 0 0 ; .* } / ) ) ;
71
+ . then ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' , / h 4 .* { .* c o l o r : # 0 0 8 0 0 0 ; .* } / ) )
72
+ . then ( ( ) => expectFileToMatch ( 'dist/styles.bundle.css' , / h 5 \s * { \s * c o l o r : # A D D A D D ; \s * } / ) )
73
+ . then ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' , / h 6 .* { .* c o l o r : # A D D A D D ; .* } / ) ) ;
60
74
}
0 commit comments