From a2b728972cdabaf68194ee78dc5aefbc1b75d537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 16 Oct 2019 09:05:16 +0200 Subject: [PATCH] Allow building single webpack modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- webpack.common.js | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/webpack.common.js b/webpack.common.js index c337ebf376..3264514606 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -17,20 +17,35 @@ const twofactor_backupscodes = require('./apps/twofactor_backupcodes/webpack') const updatenotifications = require('./apps/updatenotification/webpack') const workflowengine = require('./apps/workflowengine/webpack') +const modules = { + core, + settings, + accessibility, + comments, + files_sharing, + files_trashbin, + files_versions, + oauth2, + systemtags, + twofactor_backupscodes, + updatenotifications, + workflowengine +} + +const modulesToBuild = () => { + const MODULE = process.env.MODULE + if (MODULE) { + if (!modules[MODULE]) { + throw new Error(`No module "${MODULE}" found`) + } + return [ modules[MODULE] ] + } + return Object.values(modules) +} + module.exports = [] .concat( - core, - settings, - accessibility, - comments, - files_sharing, - files_trashbin, - files_versions, - oauth2, - systemtags, - twofactor_backupscodes, - updatenotifications, - workflowengine + ...modulesToBuild() ) .map(config => merge.smart({ module: {