litechatplus/vite.config.ts

29 lines
704 B
TypeScript
Raw Normal View History

2023-02-11 16:11:55 +00:00
import { sveltekit } from '@sveltejs/kit/vite';
import type { UserConfig } from 'vite';
import { execSync } from 'child_process';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
void !(function () {
typeof self == 'undefined' &&
typeof global == 'object' &&
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
(global.self = global);
})();
const config: UserConfig = {
plugins: [sveltekit()],
resolve: {
alias: {
'socket.io-client': 'socket.io-client/dist/socket.io.js'
}
},
define: {
__COMMIT__: JSON.stringify(execSync('git rev-parse HEAD').toString().trim().slice(0, 8))
}
};
export default config;