From 0f270504adb7fb30417c57acc267fe4daa272dcb Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Wed, 19 Feb 2025 14:21:58 +0100 Subject: [PATCH] poc: HMR for commons-ui on gridexplore and gridstudy --- vite.config.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index c3f8431f6..245e215da 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,9 +7,9 @@ import react from '@vitejs/plugin-react'; import { CommonServerOptions, defineConfig } from 'vite'; -import eslint from 'vite-plugin-eslint'; import svgr from 'vite-plugin-svgr'; import tsconfigPaths from 'vite-tsconfig-paths'; +import path from "node:path"; const serverSettings: CommonServerOptions = { port: 3000, @@ -29,13 +29,14 @@ const serverSettings: CommonServerOptions = { export default defineConfig((config) => ({ plugins: [ react(), - eslint({ - failOnWarning: config.mode !== 'development', - lintOnStart: true, - }), svgr(), // works on every import with the pattern "**/*.svg?react" tsconfigPaths(), // to resolve absolute path via tsconfig cf https://stackoverflow.com/a/68250175/5092999 ], + resolve: { + alias: { + '@gridsuite/commons-ui': path.resolve(__dirname, '../../libs/commons-ui/src'), // 🔥 On pointe vers le source, pas dist/ + }, + }, base: './', server: serverSettings, // for npm run start preview: serverSettings, // for npm run serve (use local build)