mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
b85595b8ca
Cleanup grunt config & dependencies GitOrigin-RevId: e44445e727e8cf56d03bf33a8741b9a47418a620
61 lines
1.6 KiB
CoffeeScript
61 lines
1.6 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')}"
|
|
shim:
|
|
"pdfjs-dist/build/pdf":
|
|
deps: ["libs/#{PackageVersions.lib('pdfjs')}/compatibility"]
|
|
|
|
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"]
|
|
|