File tree 3 files changed +26
-5
lines changed
3 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 23
23
"awesome-typescript-loader" : " ^3.1.3" ,
24
24
"cross-env" : " ^5.0.0" ,
25
25
"css-loader" : " ^0.28.1" ,
26
+ "dts-bundle" : " ^0.7.2" ,
26
27
"enzyme" : " ^2.8.2" ,
27
28
"es6-promise" : " ^4.1.0" ,
28
29
"extract-text-webpack-plugin" : " ^2.1.0" ,
54
55
"sass-loader" : " ^6.0.5" ,
55
56
"sinon" : " ^2.2.0" ,
56
57
"style-loader" : " ^0.17.0" ,
58
+ "ts-loader" : " ^2.0.3" ,
57
59
"tslint" : " ^5.2.0" ,
58
60
"typescript" : " ^2.3.2" ,
59
61
"url-loader" : " ^0.5.8" ,
67
69
"test" : " cross-env NODE_ENV=test karma start" ,
68
70
"clean" : " rimraf dist" ,
69
71
"start" : " webpack-dev-server --debug --output-pathinfo --history-api-fallback --hot --inline --progress --colors --port 3000 --open" ,
70
- "build" : " rimraf dist && cross-env NODE_ENV=production webpack --progress --colors && cross-env NODE_ENV=minify webpack --progress --colors" ,
72
+ "build" : " rimraf dist && cross-env NODE_ENV=production webpack --progress --colors && cross-env NODE_ENV=minify webpack --progress --colors && rimraf dist/types " ,
71
73
"analyze" : " cross-env NODE_ENV=analyze webpack --progress --colors"
72
74
}
73
75
}
Original file line number Diff line number Diff line change 4
4
"target" : " es5" ,
5
5
"lib" : [" es5" , " dom" ],
6
6
"sourceMap" : true ,
7
- "allowJs" : true ,
8
7
"jsx" : " react" ,
9
8
"experimentalDecorators" : true ,
10
9
"allowSyntheticDefaultImports" : true ,
15
14
"noImplicitAny" : false ,
16
15
"strictNullChecks" : true ,
17
16
"suppressImplicitAnyIndexErrors" : true ,
18
- "noUnusedLocals" : true
17
+ "noUnusedLocals" : true ,
18
+ "declaration" : true ,
19
+ "declarationDir" : " types"
19
20
},
20
21
"exclude" : [
21
22
" node_modules" ,
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ const base = {
41
41
// .ts, .tsx
42
42
{
43
43
test : / \. t s x ? $ / ,
44
- use : IS_PROD ? 'awesome-typescript- loader' : [ 'react-hot-loader' , 'awesome-typescript -loader' ]
44
+ use : IS_PROD ? 'ts- loader' : [ 'react-hot-loader' , 'ts -loader' ]
45
45
} ,
46
46
{
47
47
test : / \. c s s / ,
@@ -119,6 +119,22 @@ const base = {
119
119
}
120
120
} ;
121
121
122
+ function DtsBundlePlugin ( ) { }
123
+
124
+ DtsBundlePlugin . prototype . apply = function ( compiler ) {
125
+ compiler . plugin ( 'done' , function ( ) {
126
+ const dts = require ( 'dts-bundle' ) ;
127
+
128
+ dts . bundle ( {
129
+ name : 'onenotepicker' ,
130
+ main : path . resolve ( __dirname ) + '/dist/types/src/oneNotePicker.d.ts' ,
131
+ out : path . resolve ( __dirname ) + '/dist/oneNotePicker.d.ts' ,
132
+ removeSource : true ,
133
+ outputAsModuleFolder : true
134
+ } ) ;
135
+ } ) ;
136
+ } ;
137
+
122
138
const prod = {
123
139
devtool : 'source-map' ,
124
140
plugins : [
@@ -130,7 +146,8 @@ const prod = {
130
146
'process.env' : {
131
147
'NODE_ENV' : JSON . stringify ( 'production' )
132
148
}
133
- } )
149
+ } ) ,
150
+ new DtsBundlePlugin ( )
134
151
] ,
135
152
externals : {
136
153
'react' : 'React' ,
@@ -173,3 +190,4 @@ if (IS_ANALYZE) {
173
190
}
174
191
175
192
module . exports = webpackConfiguration ;
193
+
You can’t perform that action at this time.
0 commit comments