mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Instead of loading script directly use requirejs config so it can be lazy loaded
This commit is contained in:
parent
e9de83789a
commit
5e2f838af4
2 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue