From 5b9a8f0407a9e3fe7e00f0fc9284ea986905f1b5 Mon Sep 17 00:00:00 2001 From: John Molakvoæ Date: Wed, 28 Dec 2022 15:29:54 +0100 Subject: Add component testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- webpack.common.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'webpack.common.js') diff --git a/webpack.common.js b/webpack.common.js index 871218b8fa9..002ffd06e61 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -23,7 +23,7 @@ const formatOutputFromModules = (modules) => { } const modulesToBuild = () => { - const MODULE = process.env.MODULE + const MODULE = process?.env?.MODULE if (MODULE) { if (!modules[MODULE]) { throw new Error(`No module "${MODULE}" found`) @@ -49,7 +49,7 @@ module.exports = { // leak local paths https://github.com/webpack/webpack/issues/3603 devtoolNamespace: 'nextcloud', devtoolModuleFilenameTemplate(info) { - const rootDir = process.cwd() + const rootDir = process?.cwd() const rel = path.relative(rootDir, info.absoluteResourcePath) return `webpack:///nextcloud/${rel}` }, @@ -163,6 +163,11 @@ module.exports = { Buffer: ['buffer', 'Buffer'], }), ], + externals: { + OC: 'OC', + OCA: 'OCA', + OCP: 'OCP', + }, resolve: { alias: { // make sure to use the handlebar runtime when importing -- cgit v1.2.3