@@ -16,6 +16,8 @@ export default function () {
16
16
'src/pre-rename-lazy-script.js' : 'console.log(\'pre-rename-lazy-script\');' ,
17
17
'src/common-entry-script.js' : 'console.log(\'common-entry-script\');' ,
18
18
'src/common-entry-style.css' : '.common-entry-style { color: red }' ,
19
+ 'src/development-script.js' : 'console.log(\'development-script\');' ,
20
+ 'src/production-script.js' : 'console.log(\'production-script\');' ,
19
21
} )
20
22
. then ( ( ) => appendToFile ( 'src/main.ts' , 'import \'./string-script.js\';' ) )
21
23
. then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
@@ -26,7 +28,9 @@ export default function () {
26
28
{ input : 'lazy-script.js' , lazy : true } ,
27
29
{ input : 'pre-rename-script.js' , output : 'renamed-script' } ,
28
30
{ input : 'pre-rename-lazy-script.js' , output : 'renamed-lazy-script' , lazy : true } ,
29
- { input : 'common-entry-script.js' , output : 'common-entry' }
31
+ { input : 'common-entry-script.js' , output : 'common-entry' } ,
32
+ { input : 'development-script.js' , output : 'development-script' , env : 'dev' } ,
33
+ { input : 'production-script.js' , output : 'production-script' , env : 'prod' } ,
30
34
] ;
31
35
app [ 'styles' ] = [ { input : 'common-entry-style.css' , output : 'common-entry' } ] ;
32
36
} ) )
@@ -39,6 +43,7 @@ export default function () {
39
43
. then ( ( ) => expectFileToMatch ( 'dist/renamed-lazy-script.bundle.js' , 'pre-rename-lazy-script' ) )
40
44
. then ( ( ) => expectFileToMatch ( 'dist/common-entry.bundle.js' , 'common-entry-script' ) )
41
45
. then ( ( ) => expectFileToMatch ( 'dist/common-entry.bundle.css' , '.common-entry-style' ) )
46
+ . then ( ( ) => expectFileToMatch ( 'dist/development-script.bundle.js' , 'development-script' ) )
42
47
// index.html lists the right bundles
43
48
. then ( ( ) => expectFileToMatch ( 'dist/index.html' , oneLineTrim `
44
49
<link href="common-entry.bundle.css" rel="stylesheet"/>
@@ -49,6 +54,7 @@ export default function () {
49
54
<script type="text/javascript" src="scripts.bundle.js"></script>
50
55
<script type="text/javascript" src="renamed-script.bundle.js"></script>
51
56
<script type="text/javascript" src="common-entry.bundle.js"></script>
57
+ <script type="text/javascript" src="development-script.bundle.js"></script>
52
58
<script type="text/javascript" src="vendor.bundle.js"></script>
53
59
<script type="text/javascript" src="main.bundle.js"></script>
54
60
` ) )
0 commit comments