mirror of
https://github.com/JHUAPL/STIXMODELER_UI.git
synced 2026-01-08 22:07:56 -05:00
39 lines
760 B
JavaScript
39 lines
760 B
JavaScript
/// <reference types="vitest/config" />
|
|
import { defineConfig, transformWithEsbuild } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
{
|
|
name: 'treat-js-files-as-jsx',
|
|
async transform(code, id) {
|
|
if (!id.match(/src\/.*\.js$/)) return null;
|
|
|
|
// Use the exposed transform from vite, instead of directly
|
|
// transforming with esbuild
|
|
return transformWithEsbuild(code, id, {
|
|
loader: 'jsx',
|
|
jsx: 'automatic',
|
|
});
|
|
},
|
|
|
|
},
|
|
react()
|
|
],
|
|
|
|
test: {
|
|
globals: true,
|
|
environment: "jsdom",
|
|
// ...
|
|
},
|
|
|
|
optimizeDeps: {
|
|
force: true,
|
|
esbuildOptions: {
|
|
loader: {
|
|
'.js': 'jsx',
|
|
},
|
|
},
|
|
},
|
|
});
|