overleaf/services/web/Gruntfile.coffee

59 lines
1.5 KiB
CoffeeScript
Raw Normal View History

2014-02-12 05:23:40 -05:00
fs = require "fs"
PackageVersions = require "./app/coffee/infrastructure/PackageVersions"
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'
grunt.loadNpmTasks 'grunt-file-append'
2014-09-08 09:19:24 -04:00
config =
2014-02-12 05:23:40 -05:00
requirejs:
compile:
options:
optimize:"uglify2"
uglify2:
mangle: false
2014-02-12 05:23:40 -05:00
appDir: "public/js"
baseUrl: "./"
dir: "public/minjs"
inlineText: false
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')}"
"fineuploader": "libs/#{PackageVersions.lib('fineuploader')}"
2014-02-12 05:23:40 -05:00
skipDirOptimize: true
modules: [
{
name: "main",
exclude: ["libraries"]
2014-02-12 05:23:40 -05:00
}, {
name: "ide",
exclude: ["pdfjs-dist/build/pdf", "libraries"]
2017-12-13 09:19:19 -05:00
},{
name: "libraries"
2014-11-04 07:01:53 -05:00
},{
name: "ace/mode-latex"
},{
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
]
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
grunt.registerTask 'compile:minify', 'Concat and minify the client side js', ['requirejs', "file_append"]