enhance: Vite HMR while yarn dev, and more build tuning (#9361)
* enhance: Vite HMR while yarn dev, and more build tuning * use localhost Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
parent
b4b9d5d552
commit
2fe86fd869
15 changed files with 102 additions and 23 deletions
|
|
@ -2,7 +2,7 @@
|
|||
"name": "client",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"watch": "vite build --watch --mode development",
|
||||
"watch": "vite",
|
||||
"build": "vite build",
|
||||
"lint": "vue-tsc --noEmit && eslint --quiet \"src/**/*.{ts,vue}\""
|
||||
},
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import * as Acct from 'misskey-js/built/acct';
|
||||
import MkSwitch from '@/components/ui/switch.vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue';
|
||||
import bytes from '@/filters/bytes';
|
||||
|
|
|
|||
|
|
@ -159,8 +159,6 @@ import {
|
|||
} from 'chart.js';
|
||||
import { enUS } from 'date-fns/locale';
|
||||
import tinycolor from 'tinycolor2';
|
||||
import MagicGrid from 'magic-grid';
|
||||
import XMetrics from './metrics.vue';
|
||||
import XFederation from './overview.federation.vue';
|
||||
import XQueueChart from './overview.queue-chart.vue';
|
||||
import XUser from './overview.user.vue';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import * as fs from 'fs';
|
||||
import pluginVue from '@vitejs/plugin-vue';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
|
|
@ -9,11 +8,9 @@ import pluginJson5 from './vite.json5';
|
|||
const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.json', '.json5', '.svg', '.sass', '.scss', '.css', '.vue'];
|
||||
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
fs.mkdirSync(__dirname + '/../../built', { recursive: true });
|
||||
fs.writeFileSync(__dirname + '/../../built/meta.json', JSON.stringify({ version: meta.version }), 'utf-8');
|
||||
|
||||
return {
|
||||
base: '/assets/',
|
||||
base: '/vite/',
|
||||
|
||||
plugins: [
|
||||
pluginVue({
|
||||
|
|
@ -63,10 +60,10 @@ export default defineConfig(({ command, mode }) => {
|
|||
},
|
||||
},
|
||||
cssCodeSplit: true,
|
||||
outDir: __dirname + '/../../built/_client_dist_',
|
||||
outDir: __dirname + '/../../built/_vite_',
|
||||
assetsDir: '.',
|
||||
emptyOutDir: false,
|
||||
sourcemap: process.env.NODE_ENV !== 'production',
|
||||
sourcemap: process.env.NODE_ENV === 'development',
|
||||
reportCompressedSize: false,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue