From 31ff5f38b4c49294d941fa0566a4a6b5defb440b Mon Sep 17 00:00:00 2001 From: akshatg5 Date: Fri, 21 Mar 2025 01:46:51 +0530 Subject: [PATCH] fix : es-build-loader-issue --- client-react/vite.config.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/client-react/vite.config.js b/client-react/vite.config.js index bef2d13..840527f 100644 --- a/client-react/vite.config.js +++ b/client-react/vite.config.js @@ -1,29 +1,18 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; -import fs from 'fs/promises'; +// import fs from 'fs/promises'; -// https://vitejs.dev/config/ export default defineConfig({ esbuild: { - loader: "jsx", + loader: 'jsx', include: /src\/.*\.jsx?$/, - // loader: "tsx", - // include: /src\/.*\.[tj]sx?$/, exclude: [], }, optimizeDeps: { esbuildOptions: { - plugins: [ - { - name: "load-js-files-as-jsx", - setup(build) { - build.onLoad({ filter: /src\/.*\.js$/ }, async (args) => ({ - loader: "jsx", - contents: await fs.readFile(args.path, "utf8"), - })); - }, - }, - ], + loader: { + '.js': 'jsx', + }, }, }, plugins: [