diff --git a/services/web/app/coffee/infrastructure/ExpressLocals.coffee b/services/web/app/coffee/infrastructure/ExpressLocals.coffee index 0855a35c74..37cce62ddd 100644 --- a/services/web/app/coffee/infrastructure/ExpressLocals.coffee +++ b/services/web/app/coffee/infrastructure/ExpressLocals.coffee @@ -15,6 +15,7 @@ htmlEncoder = new require("node-html-encoder").Encoder("numerical") hashedFiles = {} Path = require 'path' Features = require "./Features" +Modules = require "./Modules" jsPath = if Settings.useMinifiedJs @@ -41,10 +42,9 @@ pathList = [ "#{jsPath}ide.js" "#{jsPath}main.js" "#{jsPath}libraries.js" - "#{jsPath}es/rich-text.js" "/stylesheets/style.css" "/stylesheets/ol-style.css" -] +].concat(Modules.moduleAssetFiles(jsPath)) if !Settings.useMinifiedJs logger.log "not using minified JS, not hashing static files" diff --git a/services/web/app/coffee/infrastructure/Modules.coffee b/services/web/app/coffee/infrastructure/Modules.coffee index 9d4da24c8b..769182ad94 100644 --- a/services/web/app/coffee/infrastructure/Modules.coffee +++ b/services/web/app/coffee/infrastructure/Modules.coffee @@ -43,6 +43,13 @@ module.exports = Modules = moduleIncludesAvailable: (view) -> return (Modules.viewIncludes[view] or []).length > 0 + moduleAssetFiles: (pathPrefix) -> + assetFiles = [] + for module in @modules + for assetFile in module.assetFiles or [] + assetFiles.push "#{pathPrefix}#{assetFile}" + return assetFiles + attachHooks: () -> for module in @modules if module.hooks?