Skip to content

Commit

Permalink
feat(website): Add vite bundle analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
yamadashy committed Jan 26, 2025
1 parent 3b02706 commit 7115c6f
Show file tree
Hide file tree
Showing 5 changed files with 327 additions and 10 deletions.
1 change: 1 addition & 0 deletions website/client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vitepress/cache
.vitepress/dist
node_modules
stats.html
9 changes: 9 additions & 0 deletions website/client/.vitepress/config/configShard.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig } from 'vitepress';
import { configEsSearch } from './configEs';
import { configJaSearch } from './configJa';
Expand Down Expand Up @@ -92,4 +93,12 @@ export const configShard = defineConfig({
gtag('config', '${googleAnalyticsTag}');`,
],
],

vite: {
build: {
rollupOptions: {
plugins: [visualizer()],
},
},
},
});
8 changes: 4 additions & 4 deletions website/client/components/TryItResultViewer.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script setup lang="ts">
import ace, { type Ace } from 'ace-builds';
import themeTomorrowUrl from 'ace-builds/src-noconflict/theme-tomorrow?url';
import themeTomorrowNightUrl from 'ace-builds/src-noconflict/theme-tomorrow_night?url';
import { Copy, Download } from 'lucide-vue-next';
import { useData } from 'vitepress';
import { computed, onMounted, ref, watch, defineAsyncComponent } from 'vue';
import type { PackResult } from './api/client.js';
import { computed, defineAsyncComponent, onMounted, ref, watch } from 'vue';
import { VAceEditor } from 'vue3-ace-editor';
import type { PackResult } from './api/client.js';
import { copyToClipboard, downloadResult, formatTimestamp, getEditorOptions } from './utils/resultViewer.js';
import themeTomorrowUrl from 'ace-builds/src-noconflict/theme-tomorrow?url';
import themeTomorrowNightUrl from 'ace-builds/src-noconflict/theme-tomorrow_night?url';
ace.config.setModuleUrl('ace/theme/tomorrow', themeTomorrowUrl);
ace.config.setModuleUrl('ace/theme/tomorrow_night', themeTomorrowNightUrl);
Expand Down
Loading

0 comments on commit 7115c6f

Please sign in to comment.