mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
9ff021cc88
Upgrade PDFjs to v2.0.943 GitOrigin-RevId: 79081841d64558a7fe82055c172893533466c4eb
58 lines
1.5 KiB
CoffeeScript
58 lines
1.5 KiB
CoffeeScript
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"]
|
|
|