Files
diff-viewer-extension/vite.config.js
Pierre Jacquier 28eb6ec3f3 Migrate away from CRA (#155)
* Migrate away from CRA
Fixes #128

* Add vitest

* Fix github client, still issues with kittycad

* Working e2e tests when kittycad.ts functions don't call node-fetch

* Remove cross-fetch that was causing issues in the browser (not sure why)

* Node 18, rm custom kittycad.ts, replace node-fetch

* Clean up

* Clean up and lint
2023-05-16 18:20:48 -04:00

28 lines
834 B
JavaScript

import { defineConfig } from 'vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import { configDefaults } from 'vitest/config'
import react from '@vitejs/plugin-react'
import { crx } from '@crxjs/vite-plugin'
import manifest from './manifest.json'
export default defineConfig(() => {
return {
build: {
outDir: 'build',
},
plugins: [react(), crx({ manifest }), nodePolyfills()],
resolve: {
alias: {
// Replaces node-fetch in kittycad.ts, cross-fetch wouldn't work
'node-fetch': 'isomorphic-fetch',
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: 'src/setupTests.ts',
exclude: [...configDefaults.exclude, 'tests/*'],
},
}
})