This commit is contained in:
tamaina 2022-04-23 04:04:26 +09:00
parent 73d138d8b0
commit 8a850fbe6b
4 changed files with 13 additions and 6 deletions

View File

@ -60,8 +60,6 @@
const script = document.createElement('script');
script.setAttribute('src', `/assets/${CLIENT_ENTRY}${salt}`);
script.setAttribute('async', 'true');
script.setAttribute('defer', 'true');
script.setAttribute('type', 'module');
script.addEventListener('error', async () => {
await checkUpdate();

9
packages/client/@types/env.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_APP_TITLE: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}

View File

@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
"watch": "vite build --watch",
"watch": "vite build --watch --mode development",
"build": "vite build",
"lint": "eslint --quiet 'src/**/*.{ts,vue}'"
},

View File

@ -3,13 +3,13 @@ import pluginVue from '@vitejs/plugin-vue';
import pluginJson5 from './vite.json5';
import { defineConfig } from 'vite';
import locales from '../../locales';
import meta from '../../package.json';
const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.json', '.json5', '.svg', '.sass', '.scss', '.css', '.vue'];
const isProduction = process.env.NODE_ENV === 'production';
const locales = require('../../locales');
const meta = require('../../package.json');
export default defineConfig(({ command, mode }) => {
fs.mkdirSync(__dirname + '/../../built', { recursive: true });
fs.writeFileSync(__dirname + '/../../built/meta.json', JSON.stringify({ version: meta.version }), 'utf-8');