PluginProbe
Tableberg – Simple Gutenberg Table Block / 1.1.5
Tableberg – Simple Gutenberg Table Block v1.1.5
1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 trunk 0.0.2 0.2.1 0.3.2 0.3.3 0.4.1 0.5.0 0.5.1 0.5.2 0.5.3 0.5.4 0.5.5 0.5.6 0.5.7 All 42 releases
tableberg / admin / vite.config.ts

vite.config.ts in Tableberg – Simple Gutenberg Table Block 1.1.5, at admin/vite.config.ts

52 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { defineConfig } from "vite";
2 import path from "path";
3 import react from "@vitejs/plugin-react";
4
5 const wp = ["blocks", "editor", "block-editor", "data", "blocks"];
6
7 const external: Record<string, any> = {
8 "jquery": "jQuery",
9 "lodash-es": "lodash",
10 "lodash": "lodash",
11 "moment": "moment",
12 "react-dom": "ReactDOM",
13 "react": "React",
14 };
15
16 wp.forEach(wpEntry => {
17 external[`@wordpress/${wpEntry}`] =
18 "wp." +
19 wpEntry.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
20 });
21
22 // https://vitejs.dev/config/
23 export default defineConfig({
24 plugins: [react()],
25 build: {
26 minify: "esbuild",
27 outDir: path.resolve(__dirname, "../includes/Admin/assets"),
28 lib: {
29 entry: path.resolve(__dirname, "src/index.jsx"),
30 name: "tableberg-admin-app",
31 fileName: () => "tableberg-admin.build.js",
32 formats: ["umd"],
33 },
34 rollupOptions: {
35 external: Object.keys(external),
36 output: {
37 globals: external,
38 assetFileNames: assetInfo => {
39 if (assetInfo.name === "style.css") {
40 return "tableberg-admin-style.css";
41 }
42 return assetInfo.name as string;
43 },
44 },
45 },
46 cssCodeSplit: false,
47 },
48 define: {
49 "process.env.NODE_ENV": '"production"',
50 },
51 });
52