mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-27 19:56:12 +03:00
24 lines
679 B
JavaScript
24 lines
679 B
JavaScript
import preact from '@preact/preset-vite';
|
|
import { execSync } from 'child_process';
|
|
import { resolve } from 'path';
|
|
import { defineConfig, splitVendorChunkPlugin } from 'vite';
|
|
|
|
const commitHash = execSync('git rev-parse --short HEAD').toString().trim();
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
define: {
|
|
__BUILD_TIME__: JSON.stringify(Date.now()),
|
|
__COMMIT_HASH__: JSON.stringify(commitHash),
|
|
},
|
|
plugins: [preact(), splitVendorChunkPlugin()],
|
|
build: {
|
|
sourcemap: true,
|
|
rollupOptions: {
|
|
input: {
|
|
main: resolve(__dirname, 'index.html'),
|
|
compose: resolve(__dirname, 'compose/index.html'),
|
|
},
|
|
},
|
|
},
|
|
});
|