File tree Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Expand file tree Collapse file tree 1 file changed +63
-0
lines changed Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ module . exports = function ( grunt ) {
4+ require ( "load-grunt-tasks" ) ( grunt ) ;
5+
6+ var pkgConfig = grunt . file . readJSON ( "package.json" ) ;
7+
8+ grunt . initConfig ( {
9+ pkg : pkgConfig ,
10+
11+ webpack : {
12+ options : {
13+ entry : "./src/ReactDigits.js" ,
14+ output : {
15+ path : "./dist/" ,
16+ filename : "dist.js" ,
17+ } ,
18+ stats : {
19+ colors : true ,
20+ modules : true ,
21+ reasons : true ,
22+ } ,
23+ module : {
24+ loaders : [
25+ {
26+ test : / \. j s $ / ,
27+ exclude : / n o d e _ m o d u l e s / ,
28+ loader : "babel-loader"
29+ } ,
30+ {
31+ test : / \. c s s $ / ,
32+ loader : "css-loader"
33+ } ,
34+ ]
35+ } ,
36+ externals : {
37+ // require("digits") is external and available
38+ // on the global var Digits
39+ "digits" : "Digits"
40+ }
41+ } ,
42+ dist : {
43+ cache : false
44+ }
45+ } ,
46+
47+ watch : {
48+ scripts : {
49+ files : [ "./src/*.js" ] ,
50+ tasks : [ "build" ] ,
51+ options : {
52+ atBegin : true
53+ }
54+ }
55+ }
56+
57+ } ) ;
58+
59+ grunt . loadNpmTasks ( "grunt-contrib-watch" ) ;
60+
61+ grunt . registerTask ( "build" , [ "webpack" ] ) ;
62+
63+ } ;
You can’t perform that action at this time.
0 commit comments