Skip to content

Commit

Permalink
test-config file settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Liz Hennessy authored and Liz Hennessy committed Jun 23, 2023
1 parent a508ff0 commit 3144a78
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion client/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ export default defineConfig(() => ({
},
optimizeDeps: {
esbuildOptions: {
loader: {
'.js': 'jsx',
},
plugins: [
{
name: "load-js-files-as-jsx",
setup(build) {
build.onLoad({ filter: /src\/.*\.js$/ }, async (args) => ({
loader: "jsx",
loader: 'jsx',
contents: await fs.readFile(args.path, "utf8"),
}));
},
Expand All @@ -37,3 +40,18 @@ export default defineConfig(() => ({
},
},
}));

// import { defineConfig } from 'vite';

// export default defineConfig(() => ({
// esbuild: {
// loader: 'jsx',
// },
// optimizeDeps: {
// esbuildOptions: {
// loader: {
// '.js': 'jsx',
// },
// },
// },
// }))

0 comments on commit 3144a78

Please sign in to comment.