diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index 36dc047c23e..e970138857a 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -16,7 +16,6 @@ Search "repo/branch_dropdown" in the template directory to find all occurrences. */}}
webComponents.has(tag), + }, + }, + }), + ]; +} diff --git a/vite.config.ts b/vite.config.ts index e128ee07918..ecff2975ea5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,6 @@ import {build, defineConfig} from 'vite'; -import vuePlugin from '@vitejs/plugin-vue'; import {stringPlugin} from 'vite-string-plugin'; +import {sharedPlugins, vueDefines} from './tools/shared.ts'; import {licensePlugin, wrap} from 'rolldown-license-plugin'; import {readFileSync, writeFileSync, mkdirSync, unlinkSync, globSync} from 'node:fs'; import path, {basename, join, parse} from 'node:path'; @@ -29,15 +29,6 @@ for (const path of globSync('web_src/css/themes/*.css', {cwd: import.meta.dirnam themes[parse(path).name] = join(import.meta.dirname, path); } -const webComponents = new Set([ - // our own, in web_src/js/webcomponents - 'overflow-menu', - 'relative-time', - // from dependencies - 'markdown-toolbar', - 'text-expander', -]); - function failOnWarningsPlugin(): Rolldown.Plugin { let warningCount = 0; return { @@ -305,25 +296,14 @@ export default defineConfig(commonViteOpts({ ], }, }, - define: { - __VUE_OPTIONS_API__: true, - __VUE_PROD_DEVTOOLS__: false, - __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false, - }, + define: vueDefines, plugins: [ iifePlugin('iife.ts'), iifePlugin('external-render-helper.ts'), viteDevServerPortPlugin(), reducedSourcemapPlugin(), filterCssUrlPlugin(), - stringPlugin(), - vuePlugin({ - template: { - compilerOptions: { - isCustomElement: (tag) => webComponents.has(tag), - }, - }, - }), + ...sharedPlugins(), isProduction ? licensePlugin({ done(deps, context) { const line = '-'.repeat(80); diff --git a/vitest.config.ts b/vitest.config.ts index 93218aed4db..ac58546dac4 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,6 +1,5 @@ import {defineConfig} from 'vitest/config'; -import vuePlugin from '@vitejs/plugin-vue'; -import {stringPlugin} from 'vite-string-plugin'; +import {sharedPlugins, vueDefines} from './tools/shared.ts'; export default defineConfig({ test: { @@ -21,8 +20,6 @@ export default defineConfig({ concurrent: true, }, }, - plugins: [ - stringPlugin(), - vuePlugin(), - ], + define: vueDefines, + plugins: sharedPlugins(), }); diff --git a/web_src/js/components/DashboardRepoList.vue b/web_src/js/components/DashboardRepoList.vue index a87c158dd64..63f09a89645 100644 --- a/web_src/js/components/DashboardRepoList.vue +++ b/web_src/js/components/DashboardRepoList.vue @@ -1,11 +1,11 @@ -