Skip to content

Commit 75be0fc

Browse files
fix(unity-bootstrap-theme): add bundled UMD bootstrap file to package dist
1 parent 6de875f commit 75be0fc

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/unity-bootstrap-theme/vite.config.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import react from "@vitejs/plugin-react";
2-
import { resolve } from "path";
2+
import path, { resolve } from "path";
3+
import fs from "fs";
34
import { defineConfig, transformWithEsbuild } from "vite";
45

56
import pkg from "./package.json";
@@ -21,6 +22,16 @@ const c = {
2122
});
2223
},
2324
},
25+
{
26+
name: 'copy-bootstrap-umd-to-dist',
27+
// See https://vite.dev/guide/api-plugin#universal-hooks for closeBundle info
28+
closeBundle() {
29+
const srcPath = path.resolve(__dirname, "../../node_modules", 'bootstrap/dist/js/bootstrap.bundle.min.js');
30+
const destDir = path.resolve(__dirname, 'dist/js/bootstrap.bundle.min.js');
31+
32+
fs.copyFileSync(srcPath, destDir);
33+
}
34+
}
2435
],
2536
optimizeDeps: {
2637
esbuildOptions: {

0 commit comments

Comments
 (0)