Merge pull request #442 from sharelatex/as-module-lazy-load

Lazy load rich text module
This commit is contained in:
Alasdair Smith 2018-03-23 16:03:40 +00:00 committed by GitHub
commit 13dfb8d6db
2 changed files with 3 additions and 2 deletions

View file

@ -150,6 +150,8 @@ module.exports = (app, webRouter, privateApiRouter, publicApiRouter)->
res.locals.buildWebpackPath = (jsFile, opts = {}) ->
if Settings.webpack? and !Settings.useMinifiedJs
path = Path.join(jsPath, jsFile)
if opts.removeExtension == true
path = path.slice(0,-3)
return "#{Settings.webpack.url}/public#{path}"
else
return res.locals.buildJsPath(jsFile, opts)

View file

@ -133,6 +133,7 @@ block requirejs
"fineuploader": "libs/#{lib('fineuploader')}",
"ide": "#{buildJsPath('ide.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}",
"libraries": "#{buildJsPath('libraries.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}",
!{moduleIncludes("editor:script", locals)}
},
"waitSeconds": 0,
"shim": {
@ -159,8 +160,6 @@ block requirejs
window.pdfCMapsPath = "#{pdfCMapsPath}"
window.uiConfig = JSON.parse('!{JSON.stringify(uiConfig).replace(/\//g, "\\/")}');
!= moduleIncludes("editor:script", locals)
script(
data-main=buildJsPath("ide.js", {hashedPath:false}),
baseurl=fullJsPath,