diff --git a/webpack.config.js b/webpack.config.js
index b6ecb29421..bc9b6ea9a5 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -73,6 +73,14 @@ const filterCssImport = (url, ...args) => {
 
 /** @type {import("webpack").Configuration} */
 export default {
+  externals: [
+    function ({request}, callback) {
+      if (/elkjs/.test(request)) {
+        return callback(null, `commonjs ${request}`);
+      }
+      callback();
+    },
+  ],
   mode: isProduction ? 'production' : 'development',
   entry: {
     index: [