seems to work now.

This commit is contained in:
Henry Oswald 2017-12-13 13:06:38 +00:00
parent 80e6a660be
commit 65efbbce53
3 changed files with 13 additions and 7 deletions

View file

@ -134,11 +134,15 @@ module.exports = (app, webRouter, privateApiRouter, publicApiRouter)->
res.locals.fullJsPath = Url.resolve(staticFilesBase, jsPath) res.locals.fullJsPath = Url.resolve(staticFilesBase, jsPath)
res.locals.lib = PackageVersions.lib res.locals.lib = PackageVersions.lib
res.locals.buildJsPath = (jsFile, opts = {})-> res.locals.buildJsPath = (jsFile, opts = {})->
path = Path.join(jsPath, jsFile) path = Path.join(jsPath, jsFile)
# TODO CDN?
if opts.hashedPath if opts.hashedPath
return hashedFiles[path] path = hashedFiles[path]
doFingerPrint = opts.fingerprint != false doFingerPrint = opts.fingerprint != false
@ -159,7 +163,7 @@ module.exports = (app, webRouter, privateApiRouter, publicApiRouter)->
res.locals.buildCssPath = (cssFile, opts)-> res.locals.buildCssPath = (cssFile, opts)->
path = Path.join("/stylesheets/", cssFile) path = Path.join("/stylesheets/", cssFile)
if opts.hashedPath if opts?.hashedPath
hashedPath = hashedFiles[path] hashedPath = hashedFiles[path]
return Url.resolve(staticFilesBase, hashedPath) return Url.resolve(staticFilesBase, hashedPath)
return Url.resolve(staticFilesBase, path) + "?fingerprint=" + getFingerprint(path) return Url.resolve(staticFilesBase, path) + "?fingerprint=" + getFingerprint(path)

View file

@ -142,9 +142,9 @@ html(itemscope, itemtype='http://schema.org/Product')
window.requirejs = { window.requirejs = {
"paths" : { "paths" : {
"moment": "libs/#{lib('moment')}", "moment": "libs/#{lib('moment')}",
"fineuploader": "libs/#{lib('fineuploader')}" "fineuploader": "libs/#{lib('fineuploader')}",
"main": "#{buildJsPath('main.js', {hashedPath:true, fingerprint:false}).slice(0,-3)}",
}, },
"urlArgs": "fingerprint=#{fingerprint(jsPath + 'main.js')}-#{fingerprint(jsPath + 'libs.js')}",
"config":{ "config":{
"moment":{ "moment":{
"noGlobal": true "noGlobal": true
@ -152,7 +152,7 @@ html(itemscope, itemtype='http://schema.org/Product')
} }
}; };
script( script(
data-main=buildJsPath('main.js', {hashedPath:true}), data-main=buildJsPath('main.js', {hashedPath:false, fingerprint:false}),
baseurl=fullJsPath, baseurl=fullJsPath,
src=buildJsPath('libs/require.js') src=buildJsPath('libs/require.js')
) )

View file

@ -131,7 +131,9 @@ block requirejs
"pdfjs-dist/build/pdf": "libs/#{lib('pdfjs')}/pdf", "pdfjs-dist/build/pdf": "libs/#{lib('pdfjs')}/pdf",
"pdfjs-dist/build/pdf.worker": "#{pdfWorkerPath}", "pdfjs-dist/build/pdf.worker": "#{pdfWorkerPath}",
"ace": "#{lib('ace')}", "ace": "#{lib('ace')}",
"fineuploader": "libs/#{lib('fineuploader')}" "fineuploader": "libs/#{lib('fineuploader')}",
"ide": "#{buildJsPath('ide.js', {hashedPath:true, fingerprint:false}).slice(0,-3)}",
}, },
"urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}-#{fingerprint(jsPath + 'libs.js')}", "urlArgs" : "fingerprint=#{fingerprint(jsPath + 'ide.js')}-#{fingerprint(jsPath + 'libs.js')}",
"waitSeconds": 0, "waitSeconds": 0,
@ -161,7 +163,7 @@ block requirejs
window.uiConfig = JSON.parse('!{JSON.stringify(uiConfig).replace(/\//g, "\\/")}'); window.uiConfig = JSON.parse('!{JSON.stringify(uiConfig).replace(/\//g, "\\/")}');
script( script(
data-main=buildJsPath("ide.js", {hashedPath:true}), data-main=buildJsPath("ide.js", {hashedPath:false}),
baseurl=fullJsPath, baseurl=fullJsPath,
data-ace-base=buildJsPath(lib('ace'), {fingerprint:false}), data-ace-base=buildJsPath(lib('ace'), {fingerprint:false}),
src=buildJsPath('libs/require.js', {hashedPath:true}) src=buildJsPath('libs/require.js', {hashedPath:true})