2014-02-12 05:23:40 -05:00
|
|
|
fs = require "fs"
|
2016-09-22 06:02:20 -04:00
|
|
|
PackageVersions = require "./app/coffee/infrastructure/PackageVersions"
|
2018-02-06 09:04:28 -05:00
|
|
|
Settings = require "settings-sharelatex"
|
2017-01-18 10:38:18 -05:00
|
|
|
require('es6-promise').polyfill()
|
2014-02-12 05:23:40 -05:00
|
|
|
|
|
|
|
module.exports = (grunt) ->
|
|
|
|
grunt.loadNpmTasks 'grunt-contrib-requirejs'
|
2015-10-09 05:11:38 -04:00
|
|
|
grunt.loadNpmTasks 'grunt-file-append'
|
|
|
|
|
2014-09-08 09:19:24 -04:00
|
|
|
config =
|
2016-06-15 07:08:11 -04:00
|
|
|
|
2014-02-12 05:23:40 -05:00
|
|
|
requirejs:
|
|
|
|
compile:
|
|
|
|
options:
|
2014-06-16 13:29:55 -04:00
|
|
|
optimize:"uglify2"
|
|
|
|
uglify2:
|
|
|
|
mangle: false
|
2014-02-12 05:23:40 -05:00
|
|
|
appDir: "public/js"
|
|
|
|
baseUrl: "./"
|
|
|
|
dir: "public/minjs"
|
|
|
|
inlineText: false
|
2017-06-26 11:14:03 -04:00
|
|
|
generateSourceMaps: true
|
2014-02-12 05:23:40 -05:00
|
|
|
preserveLicenseComments: false
|
|
|
|
paths:
|
2016-09-22 06:36:53 -04:00
|
|
|
"moment": "libs/#{PackageVersions.lib('moment')}"
|
2015-01-29 13:11:38 -05:00
|
|
|
"mathjax": "/js/libs/mathjax/MathJax.js?config=TeX-AMS_HTML"
|
2016-10-13 09:51:21 -04:00
|
|
|
"pdfjs-dist/build/pdf": "libs/#{PackageVersions.lib('pdfjs')}/pdf"
|
2016-10-12 04:52:15 -04:00
|
|
|
"ace": "#{PackageVersions.lib('ace')}"
|
2017-12-01 06:22:41 -05:00
|
|
|
"fineuploader": "libs/#{PackageVersions.lib('fineuploader')}"
|
2014-02-12 05:23:40 -05:00
|
|
|
|
|
|
|
skipDirOptimize: true
|
|
|
|
modules: [
|
|
|
|
{
|
|
|
|
name: "main",
|
2017-12-13 12:07:58 -05:00
|
|
|
exclude: ["libraries"]
|
2014-02-12 05:23:40 -05:00
|
|
|
}, {
|
|
|
|
name: "ide",
|
2017-12-13 12:07:58 -05:00
|
|
|
exclude: ["pdfjs-dist/build/pdf", "libraries"]
|
2017-12-13 09:19:19 -05:00
|
|
|
},{
|
2017-12-13 12:07:58 -05:00
|
|
|
name: "libraries"
|
2014-11-04 07:01:53 -05:00
|
|
|
},{
|
|
|
|
name: "ace/mode-latex"
|
2016-09-14 10:17:24 -04:00
|
|
|
},{
|
|
|
|
name: "ace/worker-latex"
|
2014-02-12 05:23:40 -05:00
|
|
|
}
|
2014-11-04 07:01:53 -05:00
|
|
|
|
2014-02-12 05:23:40 -05:00
|
|
|
]
|
|
|
|
|
2015-10-09 05:11:38 -04:00
|
|
|
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'
|
|
|
|
}]
|
|
|
|
|
2014-09-08 09:19:24 -04:00
|
|
|
grunt.initConfig config
|
2019-01-29 05:10:13 -05:00
|
|
|
grunt.registerTask 'compile:minify', 'Concat and minify the client side js', ['requirejs', "file_append"]
|
2015-11-18 10:21:48 -05:00
|
|
|
|