-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite-frame.config.ts
46 lines (42 loc) · 1.21 KB
/
vite-frame.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// vite.config.js
import solidPlugin from 'vite-plugin-solid';
import WindiCSS from "vite-plugin-windicss";
import { resolve } from "path";
const root = resolve(__dirname, "src");
import { spawn } from 'child_process';
const args = process.argv.slice(2);
const isWatch = args.includes('-w');
export default {
plugins: [solidPlugin(), WindiCSS()],
resolve: {
alias: {
"@src": root
},
},
build: {
minify: false,
rollupOptions: {
input: 'src/frame-manager.tsx', // Path to your SolidJS file
output: {
entryFileNames: "[name].js",
assetFileNames: `assets/[name].[ext]`
},
plugins: [isWatch ? {
name: 'run-build',
closeBundle () {
const postBundleProcess = spawn('npm', ['run', 'build']);
postBundleProcess.stdout.on('data', (data) => {
console.log(`${data}`);
});
postBundleProcess.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});
postBundleProcess.on('close', (code) => {
console.log(`Post-bundle script exited with code ${code}`);
});
}
}: null]
},
outDir: root + '/sandbox'
},
};