File tree 4 files changed +10
-12
lines changed
packages/@ngtools/webpack/src
4 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,10 @@ export class ExtractI18nPlugin implements Tapable {
138
138
return cb ( new Error ( 'An @ngtools/webpack xi18n plugin already exist for ' +
139
139
'this compilation.' ) ) ;
140
140
}
141
+ if ( ! this . _compilation . _ngToolsWebpackPluginInstance ) {
142
+ return cb ( new Error ( 'An @ngtools/webpack aot plugin does not exists ' +
143
+ 'for this compilation' ) ) ;
144
+ }
141
145
142
146
this . _compilation . _ngToolsWebpackXi18nPluginInstance = this ;
143
147
Original file line number Diff line number Diff line change 1
1
import { join } from 'path' ;
2
2
import { ng } from '../../utils/process' ;
3
3
import {
4
- expectFileToExist , deleteFile , writeFile ,
4
+ expectFileToExist , writeFile ,
5
5
expectFileToMatch
6
6
} from '../../utils/fs' ;
7
7
8
8
9
9
export default function ( ) {
10
- const testComponentDir = join ( 'src/app' , 'i18n-test' ) ;
11
10
return ng ( 'generate' , 'component' , 'i18n-test' )
12
- . then ( ( ) => deleteFile ( join ( testComponentDir , 'i18n-test.component.html' ) ) )
13
11
. then ( ( ) => writeFile (
14
- join ( testComponentDir , 'i18n-test.component.html' ) ,
12
+ join ( 'src/app/i18n-test' , 'i18n-test.component.html' ) ,
15
13
'<p i18n>Hello world</p>' ) )
16
14
. then ( ( ) => ng ( 'xi18n' , '--no-progress' ) )
17
15
. then ( ( ) => expectFileToExist ( join ( 'src' , 'messages.xlf' ) ) )
Original file line number Diff line number Diff line change 1
1
import { join } from 'path' ;
2
2
import { ng } from '../../utils/process' ;
3
3
import {
4
- expectFileToExist , deleteFile , writeFile ,
4
+ expectFileToExist , writeFile ,
5
5
expectFileToMatch
6
6
} from '../../utils/fs' ;
7
7
8
8
9
9
export default function ( ) {
10
- const testComponentDir = join ( 'src/app' , 'i18n-test' ) ;
11
10
return ng ( 'generate' , 'component' , 'i18n-test' )
12
- . then ( ( ) => deleteFile ( join ( testComponentDir , 'i18n-test.component.html' ) ) )
13
11
. then ( ( ) => writeFile (
14
- join ( testComponentDir , 'i18n-test.component.html' ) ,
12
+ join ( 'src/app/i18n-test' , 'i18n-test.component.html' ) ,
15
13
'<p i18n>Hello world</p>' ) )
16
14
. then ( ( ) => ng ( 'xi18n' , '--no-progress' , '--output-path' , 'src/locale' ) )
17
15
. then ( ( ) => expectFileToExist ( join ( 'src' , 'locale' , 'messages.xlf' ) ) )
Original file line number Diff line number Diff line change 1
1
import { join } from 'path' ;
2
2
import { ng } from '../../utils/process' ;
3
3
import {
4
- expectFileToExist , deleteFile , writeFile ,
4
+ expectFileToExist , writeFile ,
5
5
expectFileToMatch
6
6
} from '../../utils/fs' ;
7
7
8
8
9
9
export default function ( ) {
10
- const testComponentDir = join ( 'src/app' , 'i18n-test' ) ;
11
10
return ng ( 'generate' , 'component' , 'i18n-test' )
12
- . then ( ( ) => deleteFile ( join ( testComponentDir , 'i18n-test.component.html' ) ) )
13
11
. then ( ( ) => writeFile (
14
- join ( testComponentDir , 'i18n-test.component.html' ) ,
12
+ join ( 'src/app/i18n-test' , 'i18n-test.component.html' ) ,
15
13
'<p i18n>Hello world</p>' ) )
16
14
. then ( ( ) => ng ( 'xi18n' , '--no-progress' , '--i18n-format' , 'xmb' ) )
17
15
. then ( ( ) => expectFileToExist ( join ( 'src' , 'messages.xmb' ) ) )
You can’t perform that action at this time.
0 commit comments