Skip to content

Commit 529d1cc

Browse files
author
Andreas Savvides
committed
Adding a Gruntfile that can handle Digits too
1 parent 7455645 commit 529d1cc

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

Gruntfile.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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: /\.js$/,
27+
exclude: /node_modules/,
28+
loader: "babel-loader"
29+
},
30+
{
31+
test: /\.css$/,
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+
};

0 commit comments

Comments
 (0)