aboutsummaryrefslogtreecommitdiffstats
path: root/webpack.common.js
diff options
context:
space:
mode:
Diffstat (limited to 'webpack.common.js')
-rw-r--r--webpack.common.js9
1 files changed, 7 insertions, 2 deletions
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