# tableberg/1.1.5/admin/vite.config.ts

Tableberg – Simple Gutenberg Table Block, version 1.1.5. 52 lines.

- Page: https://pluginprobe.com/plugins/tableberg/1.1.5/code/admin/vite.config.ts
- Raw: https://pluginprobe.com/plugins/tableberg/1.1.5/raw/admin/vite.config.ts
- Modified: 2026-09-16T03:30:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/tableberg/1.1.5/code/admin/vite.config.ts#L10-L20`.

```typescript
import { defineConfig } from "vite";
import path from "path";
import react from "@vitejs/plugin-react";

const wp = ["blocks", "editor", "block-editor", "data", "blocks"];

const external: Record<string, any> = {
    "jquery": "jQuery",
    "lodash-es": "lodash",
    "lodash": "lodash",
    "moment": "moment",
    "react-dom": "ReactDOM",
    "react": "React",
};

wp.forEach(wpEntry => {
    external[`@wordpress/${wpEntry}`] =
        "wp." +
        wpEntry.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
});

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [react()],
    build: {
        minify: "esbuild",
        outDir: path.resolve(__dirname, "../includes/Admin/assets"),
        lib: {
            entry: path.resolve(__dirname, "src/index.jsx"),
            name: "tableberg-admin-app",
            fileName: () => "tableberg-admin.build.js",
            formats: ["umd"],
        },
        rollupOptions: {
            external: Object.keys(external),
            output: {
                globals: external,
                assetFileNames: assetInfo => {
                    if (assetInfo.name === "style.css") {
                        return "tableberg-admin-style.css";
                    }
                    return assetInfo.name as string;
                },
            },
        },
        cssCodeSplit: false,
    },
    define: {
        "process.env.NODE_ENV": '"production"',
    },
});

```
