@@ -30,15 +30,25 @@ export default function () {
3030 @import 'variables'
3131 h4
3232 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; }
3342 `
3443 } ) )
3544 . 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' ` ) )
3746 . then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
3847 const app = configJson [ 'apps' ] [ 0 ] ;
3948 app [ 'styles' ] = [
4049 'styles.scss' ,
41- 'styles.styl'
50+ 'styles.styl' ,
51+ 'styles.less'
4252 ] ;
4353 app [ 'stylePreprocessorOptions' ] = {
4454 includePaths : [
@@ -52,9 +62,13 @@ export default function () {
5262 . then ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' , / h 2 .* { .* c o l o r : r e d ; .* } / ) )
5363 . then ( ( ) => expectFileToMatch ( 'dist/styles.bundle.css' , / h 3 \s * { \s * c o l o r : # 0 0 8 0 0 0 ; \s * } / ) )
5464 . 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 ; .* } / ) )
5567 . then ( ( ) => ng ( 'build' , '--extract-css' , '--aot' ) )
5668 . then ( ( ) => expectFileToMatch ( 'dist/styles.bundle.css' , / h 1 \s * { \s * c o l o r : r e d ; \s * } / ) )
5769 . then ( ( ) => expectFileToMatch ( 'dist/main.bundle.js' , / h 2 .* { .* c o l o r : r e d ; .* } / ) )
5870 . 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 ; .* } / ) ) ;
6074}
0 commit comments