-
Notifications
You must be signed in to change notification settings - Fork 13
/
Gruntfile.js
89 lines (83 loc) · 2.28 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
'use strict';
const saveLicense = require('uglify-save-license');
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
main: {
expand: true,
flatten: true,
src: [
'node_modules/jquery/dist/jquery.js',
'node_modules/sisyphus.js/sisyphus.js',
'node_modules/remote-ac/ac.js',
'node_modules/jquery-powertip/dist/jquery.powertip.js',
'node_modules/jquery-modal/jquery.modal.js'
],
dest: 'static/js/'
},
editorStyles: {
expand: true,
flatten: true,
src: [
'node_modules/prosemirror-view/style/prosemirror.css',
'node_modules/prosemirror-menu/style/menu.css'
],
dest: 'static/css/editor/'
}
},
browserify: {
editor: {
src: 'frontend/editor.js',
dest: 'build/editor-es6-bundle.js'
},
review: {
src: 'frontend/review.js',
dest: 'build/review-es6-bundle.js'
}
},
babel: {
mainJS: {
options: {
sourceMap: true,
presets: ['env']
},
files: {
'static/js/libreviews.js': 'frontend/libreviews.js',
'static/js/register.js': 'frontend/register.js',
'static/js/review.js': 'build/review-es6-bundle.js',
'static/js/upload.js': 'frontend/upload.js',
'static/js/user.js': 'frontend/user.js',
'static/js/manage-urls.js': 'frontend/manage-urls.js',
'static/js/editor.js': 'build/editor-es6-bundle.js'
}
}
},
concat: {
libJS: {
src: [
'static/js/jquery.js',
'static/js/jquery.powertip.js',
'static/js/jquery.modal.js',
'static/js/sisyphus.js',
'static/js/ac.js',
'static/js/libreviews.js'
],
dest: 'static/js/lib.js'
},
},
uglify: {
options: {
preserveComments: saveLicense
},
mainJS: {
files: {
'static/js/lib.min.js': ['static/js/lib.js'],
'static/js/editor.min.js': ['static/js/editor.js']
}
},
}
});
grunt.registerTask('default', ['copy', 'browserify', 'babel', 'concat', 'uglify']);
};