forked from CCALI/a2jviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
98 lines (89 loc) · 2.38 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
90
91
92
93
94
95
96
97
98
module.exports = function (grunt) { // documentjs tasks removed until security updates can be applied see: https://github.com/CCALI/CAJA/issues/2485
const path = require('path-browserify')
grunt.initConfig({
clean: {
build: ['dist/']
// cachedTemplate: ['node_modules/documentjs/site/static', 'node_modules/documentjs/site/templates']
},
run: {
options: {
// Task-specific options go here.
},
make_viewer_production: {
cmd: 'node',
args: [
'build.production.html.js'
]
}
},
// copy: {
// 'icon-font': {
// expand: true,
// cwd: 'styles/',
// src: 'icon-font/**/*',
// dest: 'docs/demos/'
// },
// demos: {
// expand: true,
// cwd: 'styles/style-guide/',
// src: 'demos/**/*',
// dest: 'docs/'
// }
// },
less: {
// docs: {
// files: {
// 'docs/author.css': 'caja/author/styles.less',
// 'docs/viewer.css': 'a2jviewer/styles.less'
// }
// },
svg: {
options: {
compress: true,
yuicompress: true,
optimization: 2
},
files: {
'~/styles/viewer-avatars.css': '~/styles/viewer/avatars.less'
}
}
},
'steal-build': {
viewer: {
options: {
steal: {
main: ['@caliorg/a2jviewer/app'],
config: path.join(__dirname, '/package.json!npm')
},
buildOptions: {
minify: true,
sourceMaps: false,
bundleSteal: false
}
}
}
}
})
// grunt.loadNpmTasks('documentjs')
grunt.loadNpmTasks('grunt-steal')
// grunt.loadNpmTasks('grunt-contrib-less')
// grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-run')
// grunt.renameTask('documentjs', 'documentjs-orig')
grunt.registerTask('svg-styles', ['less:svg'])
grunt.registerTask('build', ['clean:build', 'steal-build', 'run:make_viewer_production'])
// grunt.registerTask('documentjs', [
// 'clean:cachedTemplate',
// 'documentjs-orig',
// 'copy:icon-font',
// 'copy:demos',
// 'less:docs'
// ])
// grunt.registerTask('documentjs-lite', [
// 'documentjs-orig',
// 'copy:icon-font',
// 'copy:demos',
// 'less:docs'
// ])
}