From a3817291d7795345542b63641e265fe8f29e8750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Thu, 29 Sep 2022 15:37:07 +0200 Subject: [PATCH] fix(editor-ui): make lodash aliases work on case-sensitive filesystems (#4233) --- packages/editor-ui/vite.config.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/editor-ui/vite.config.ts b/packages/editor-ui/vite.config.ts index 4db49f6eb35a8..0be496805d967 100644 --- a/packages/editor-ui/vite.config.ts +++ b/packages/editor-ui/vite.config.ts @@ -26,6 +26,11 @@ function renderChunks() { const publicPath = process.env.VUE_APP_PUBLIC_PATH || '/'; +const lodashAliases = ['orderBy', 'camelCase', 'cloneDeep', 'isEqual'].map(name => ({ + find: new RegExp(`^lodash.${name}$`, 'i'), + replacement: require.resolve(`lodash-es/${name}`), +})) + export default defineConfig({ plugins: [ legacy({ @@ -52,21 +57,14 @@ export default defineConfig({ find: /^n8n-design-system\//, replacement: resolve(__dirname, '..', 'design-system', 'src') + '/', }, - { - find: /^lodash.orderby$/, - replacement: 'lodash-es/orderBy', - }, - { - find: /^lodash.camelcase$/, - replacement: 'lodash-es/camelCase', - }, + ...lodashAliases, { find: /^lodash.(.+)$/, replacement: 'lodash-es/$1', }, { find: 'vue2-boring-avatars', - replacement: resolve(__dirname, '..', '..', 'node_modules', 'vue2-boring-avatars', 'dist', 'vue-2-boring-avatars.umd.js'), // Workaround for wrong main/module/exports field in vue2-boring-avatar's package.json + replacement: require.resolve('vue2-boring-avatars'), }, { find: /element-ui\/(packages|lib)\/button$/,