File tree 1 file changed +44
-0
lines changed
1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ const path = require ( "path" ) ;
2
+ const webpack = require ( "webpack" ) ;
3
+
4
+ const DEBUG = process . env . NODE_ENV !== "production" ;
5
+
6
+ module . exports = {
7
+ entry : {
8
+ "index" : [
9
+ path . resolve ( __dirname , INPUTFILE )
10
+ ]
11
+ } ,
12
+ devtool : DEBUG ? "inline-sourcemap" : false ,
13
+ cache : true ,
14
+ output : {
15
+ path : path . resolve ( __dirname , 'libs/' ) ,
16
+ filename : "[name].js"
17
+ } ,
18
+ module : {
19
+ rules : [
20
+ {
21
+ test : / \. ( t s | j s ) $ / ,
22
+ exclude : / ( n o d e _ m o d u l e s ) / ,
23
+ use : {
24
+ loader : "ts-loader"
25
+ }
26
+ }
27
+ ]
28
+ } ,
29
+ resolve : {
30
+ extensions : [
31
+ ".ts" ,
32
+ ".js"
33
+ ]
34
+ } ,
35
+ plugins : [ ]
36
+ } ;
37
+
38
+ if ( ! DEBUG ) {
39
+ module . exports . output . filename = "[name].min.js" ;
40
+
41
+ module . exports . plugins . push (
42
+ new webpack . optimize . UglifyJsPlugin ( )
43
+ ) ;
44
+ }
You can’t perform that action at this time.
0 commit comments