@@ -8,11 +8,26 @@ const { LocalizationPlugin } = require('@microsoft/localization-plugin');
88module . exports = function ( env ) {
99 const configuration = {
1010 mode : 'production' ,
11+ module : {
12+ rules : [
13+ {
14+ test : / \. t s x ? $ / ,
15+ loader : require . resolve ( 'ts-loader' ) ,
16+ exclude : / ( n o d e _ m o d u l e s ) / ,
17+ options : {
18+ compiler : require . resolve ( '@microsoft/rush-stack-compiler-3.2/node_modules/typescript' ) ,
19+ logLevel : 'ERROR' ,
20+ configFile : path . resolve ( __dirname , 'tsconfig.json' )
21+ }
22+ }
23+ ]
24+ } ,
25+ context : path . resolve ( __dirname , 'src' ) ,
1126 resolve : {
12- extensions : [ '.js' , '.jsx' , '.json' ] ,
27+ extensions : [ '.js' , '.jsx' , '.json' , '.ts' , '.tsx' ]
1328 } ,
1429 entry : {
15- 'localization-test' : path . join ( __dirname , 'lib ' , 'index.js ' )
30+ 'localization-test' : path . join ( __dirname , 'src ' , 'index.ts ' )
1631 } ,
1732 output : {
1833 path : path . join ( __dirname , 'dist' ) ,
@@ -25,7 +40,32 @@ module.exports = function(env) {
2540 plugins : [
2641 new webpack . optimize . ModuleConcatenationPlugin ( ) ,
2742 new LocalizationPlugin ( {
28-
43+ localizedStrings : {
44+ "en-us" : {
45+ "./strings1.loc.json" : {
46+ "string1" : "the first string"
47+ } ,
48+ "./strings2.loc.json" : {
49+ "string1" : "the second string"
50+ } ,
51+ "./strings3.loc.json" : {
52+ "string1" : "the third string" ,
53+ "string2" : "the fourth string" ,
54+ }
55+ } ,
56+ "es-es" : {
57+ "./strings1.loc.json" : {
58+ "string1" : "la primera cadena"
59+ } ,
60+ "./strings2.loc.json" : {
61+ "string1" : "la segunda cadena"
62+ } ,
63+ "./strings3.loc.json" : {
64+ "string1" : "la tercera cadena" ,
65+ "string2" : "la cuarta cadena" ,
66+ }
67+ }
68+ }
2969 } )
3070 ]
3171 } ;
0 commit comments