diff --git a/packages/webapp/Dockerfile b/packages/webapp/Dockerfile
index 58a754df4..a86d52488 100644
--- a/packages/webapp/Dockerfile
+++ b/packages/webapp/Dockerfile
@@ -24,4 +24,4 @@ RUN pnpm run build:webapp
FROM nginx
COPY ./packages/webapp/nginx/sites/default.conf /etc/nginx/conf.d/default.conf
-COPY --from=build /app/packages/webapp/build /usr/share/nginx/html
+COPY --from=build /app/packages/webapp/dist /usr/share/nginx/html
diff --git a/packages/webapp/public/index.html b/packages/webapp/public/index.html
deleted file mode 100644
index e177a81a6..000000000
--- a/packages/webapp/public/index.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Bigcapital
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/webapp/src/store/settings/settings.reducer.tsx b/packages/webapp/src/store/settings/settings.reducer.tsx
index dea83d2cc..9a84e456a 100644
--- a/packages/webapp/src/store/settings/settings.reducer.tsx
+++ b/packages/webapp/src/store/settings/settings.reducer.tsx
@@ -62,9 +62,6 @@ const initialState = {
warehouseTransfer: {
tableSize: 'small',
},
- projectTasks: {
- tableSize: 'small',
- },
projectTasks: {
tableSize: 'medium',
},
diff --git a/packages/webapp/vite.config.ts b/packages/webapp/vite.config.ts
new file mode 100644
index 000000000..4f0555f8f
--- /dev/null
+++ b/packages/webapp/vite.config.ts
@@ -0,0 +1,100 @@
+import react from '@vitejs/plugin-react';
+import { readFile } from 'node:fs/promises';
+import path from 'node:path';
+import { defineConfig, loadEnv, Plugin } from 'vite';
+
+const allowedEnvPrefixes = ['VITE_', 'REACT_APP_', 'PUBLIC_URL'];
+
+const reactVirtualizedCompat = (): Plugin => ({
+ name: 'react-virtualized-compat',
+ enforce: 'pre',
+ transform(code, id) {
+ const needsShim =
+ id.includes(
+ 'node_modules/react-virtualized/dist/es/WindowScroller/utils/onScroll.js',
+ ) ||
+ id.includes(
+ 'node_modules/react-virtualized/dist/es/WindowScroller/utils/dimensions.js',
+ );
+ if (needsShim) {
+ console.info('Applying react-virtualized shim:', id);
+ return code.replace(
+ /import \{ bpfrpt_proptype_WindowScroller \} from "\.\.\/WindowScroller\.js";/g,
+ 'const bpfrpt_proptype_WindowScroller = null;',
+ );
+ }
+
+ return null;
+ },
+});
+
+const reactVirtualizedOptimizePatch = () => ({
+ name: 'react-virtualized-optimize-patch',
+ setup(build) {
+ const filter =
+ /react-virtualized\/dist\/es\/WindowScroller\/utils\/(onScroll|dimensions)\.js$/;
+ build.onLoad({ filter }, async args => {
+ const contents = await readFile(args.path, 'utf-8');
+ return {
+ contents: contents.replace(
+ /import \{ bpfrpt_proptype_WindowScroller \} from "\.\.\/WindowScroller\.js";/g,
+ 'const bpfrpt_proptype_WindowScroller = null;',
+ ),
+ loader: 'js',
+ };
+ });
+ },
+});
+
+const pickClientEnv = (env: Record) =>
+ Object.fromEntries(
+ Object.entries(env).filter(([key]) =>
+ allowedEnvPrefixes.some(prefix => key.startsWith(prefix)),
+ ),
+ );
+
+// https://vitejs.dev/config/
+export default defineConfig(({ mode }) => {
+ const rootDir = __dirname;
+ const env = loadEnv(mode, rootDir, '');
+ const clientEnv = pickClientEnv(env);
+ const port = Number(env.PORT) || 4000;
+
+ return {
+ plugins: [react(), reactVirtualizedCompat()],
+ root: rootDir,
+ resolve: {
+ alias: {
+ '@': path.resolve(rootDir, 'src'),
+ '@public': path.resolve(rootDir, 'public'),
+ path: 'path-browserify',
+ },
+ },
+ define: {
+ 'process.env': {
+ NODE_ENV: mode,
+ PUBLIC_URL: clientEnv.PUBLIC_URL ?? '/',
+ ...clientEnv,
+ },
+ },
+ server: {
+ host: true,
+ port,
+ proxy: {
+ '/api': {
+ target: env.VITE_API_PROXY_TARGET || 'http://localhost:3000',
+ changeOrigin: true,
+ },
+ },
+ },
+ build: {
+ outDir: 'dist',
+ },
+ optimizeDeps: {
+ esbuildOptions: {
+ plugins: [reactVirtualizedOptimizePatch()],
+ },
+ },
+ };
+});
+