From cf9c02c30b63c46d2fd98d4057c5c82d6c4014c4 Mon Sep 17 00:00:00 2001 From: "Ricardo M." Date: Wed, 22 Jan 2025 10:03:00 +0100 Subject: [PATCH] chore(vite): Normalize SCSS node_modules imports After forwarding `DragDrop.scss`, we need to instruct `vite` to import files starting with `~` from the `node_modules` folder. This commit normalizes the required configuration to do so. Comes from: https://github.com/KaotoIO/kaoto/pull/1927 Relates: https://github.com/KaotoIO/kaoto/pull/1927/files#r1924952467 --- packages/ui-tests/.storybook/main.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/ui-tests/.storybook/main.ts b/packages/ui-tests/.storybook/main.ts index 36b70c59d..a0b302fa3 100644 --- a/packages/ui-tests/.storybook/main.ts +++ b/packages/ui-tests/.storybook/main.ts @@ -1,6 +1,6 @@ import type { StorybookConfig } from '@storybook/react-vite'; -import { dirname, join, resolve } from 'path'; +import { dirname, join } from 'path'; import packageJson from '../../../package.json'; /** @@ -57,8 +57,10 @@ const config: StorybookConfig = { resolve: { alias: [ { - find: /~(.*)/, - replacement: '$1', + find: /^~.+/, + replacement: (val) => { + return val.replace(/^~/, ''); + }, }, ], },