-
Notifications
You must be signed in to change notification settings - Fork 36
/
Gruntfile.js
59 lines (48 loc) · 1.57 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module.exports = function(grunt) {
var babel = require('rollup-plugin-babel');
var nodeResolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
var riot = require('rollup-plugin-riot');
var uglify = require('rollup-plugin-uglify');
var ruReplace = require('rollup-plugin-replace');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
client: {
files: ['client/*.js', 'client/**/.tag'],
tasks: ['build']
}
},
rollup: {
options: {
entry: './client/app.js',
plugins: [
riot(),
nodeResolve({
main: true,
jsnext: true,
browser: true
}),
ruReplace({
'process.env.NODE_ENV': JSON.stringify('production')
}),
commonjs(),
babel({
exclude: 'node_modules/**',
presets: ['es2015-rollup']
})//,
/*uglify({
wrap: true
})*/
]
},
files: {
src: 'client/app.js',
dest: 'assets/app.js'
}
}
});
grunt.loadNpmTasks('grunt-rollup');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('build', ['rollup']);
};