forked from overleaf/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
58 lines (50 loc) · 1.47 KB
/
Gruntfile.coffee
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
fs = require "fs"
PackageVersions = require "./app/coffee/infrastructure/PackageVersions"
Settings = require "settings-sharelatex"
require('es6-promise').polyfill()
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-contrib-requirejs'
grunt.loadNpmTasks 'grunt-file-append'
config =
requirejs:
compile:
options:
optimize:"uglify2"
uglify2:
mangle: false
appDir: "public/js"
baseUrl: "./"
dir: "public/minjs"
inlineText: false
generateSourceMaps: true
preserveLicenseComments: false
paths:
"moment": "libs/#{PackageVersions.lib('moment')}"
"mathjax": "/js/libs/mathjax/MathJax.js?config=TeX-AMS_HTML"
"pdfjs-dist/build/pdf": "libs/#{PackageVersions.lib('pdfjs')}/pdf"
"ace": "#{PackageVersions.lib('ace')}"
"fineuploader": "libs/#{PackageVersions.lib('fineuploader')}"
skipDirOptimize: true
modules: [
{
name: "main",
exclude: ["libraries"]
}, {
name: "ide",
exclude: ["pdfjs-dist/build/pdf", "libraries"]
},{
name: "libraries"
},{
name: "ace/mode-latex"
},{
name: "ace/worker-latex"
}
]
file_append:
default_options: files: [ {
append: '\n//ide.js is complete - used for automated testing'
input: 'public/minjs/ide.js'
output: 'public/minjs/ide.js'
}]
grunt.initConfig config
grunt.registerTask 'compile:minify', 'Concat and minify the client side js', ['requirejs', "file_append"]