jasquat 9147a8db8c
Use vite to build (#1390)
* some base updates for vite w/ burnettk

* i can log in w/ burnettk

* a couple more fixes w/ burnettk

* make sure selectedTabIndex has been set before using it w/ burnettk

* fixed active-users db issue, added type module to package json to fix prerender issues, and various other issues w/ burnettk

* fixed issues with building and running from compiled w/ burnettk

* pyl

* eslint fix is running and removed both inferno and navigationBar warnings

* vim likes the Dockerfile suffix by default

* use process.env.HOME

* probably do not need alias

* a little clean up and fixed font warnings w/ burnettk

* updated elements to remove warnings in the console w/ burnettk

* fixed es lint issues w/ burnettk

* update docker build in frontend w/ burnettk

* set the specific tag of nginx w/ burnettk

* build docker imgaes for this branch to test w/ burnettk

* added vitest and updated Dockerfile to be nginx w/ burnettk

* tests are passing w/ burnettk

* add prefresh and more keys

* added cypress-vite to attempt to get cypress working again

* some coderabbit suggestions

* hopefully there is no reason to use PUBLIC_URL at all when using vite

* use the correct location of the index file in the docker image

* spaces are fine in index.html file variable declaration

---------

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
Co-authored-by: burnettk <burnettk@users.noreply.github.com>
2024-04-15 14:22:34 -04:00

43 lines
1.3 KiB
TypeScript

import preact from '@preact/preset-vite';
import prefresh from '@prefresh/vite';
import { defineConfig } from 'vite';
// import react from '@vitejs/plugin-react';
import viteTsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
// depending on your application, base can also be "/"
base: '/',
plugins: [
// react(),
// seems to replace preact. hot module replacement doesn't work, so commented out. also causes errors when navigating with TabList:
// Cannot read properties of undefined (reading 'disabled')
// prefresh(),
// we need preact for bpmn-js-spiffworkflow. see https://forum.bpmn.io/t/custom-prop-for-service-tasks-typeerror-cannot-add-property-object-is-not-extensible/8487
preact(),
viteTsconfigPaths(),
],
// for prefresh, from https://github.com/preactjs/prefresh/issues/454#issuecomment-1456491801, not working
// optimizeDeps: {
// include: ['preact/hooks', 'preact/compat', 'preact']
// },
server: {
// this ensures that the browser DOES NOT open upon server start
open: false,
port: 7001,
},
preview: {
port: 7001,
},
resolve: {
alias: {
inferno:
process.env.NODE_ENV !== 'production'
? 'inferno/dist/index.dev.esm.js'
: 'inferno/dist/index.esm.js',
},
preserveSymlinks: true,
},
});