diff options
author | silverwind <me@silverwind.io> | 2023-07-08 06:56:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-08 04:56:12 +0000 |
commit | 62f3c0fe76f215cbe88b1a76408b09d74ad14f92 (patch) | |
tree | 3ef6dc06bc8a9afa5fa35136870c18b400cb0d0b /vitest.config.js | |
parent | 6375419468edc95fdfac94aac3b0e10b23743557 (diff) | |
download | gitea-62f3c0fe76f215cbe88b1a76408b09d74ad14f92.tar.gz gitea-62f3c0fe76f215cbe88b1a76408b09d74ad14f92.zip |
Switch to `vite-string-plugin` (#25762)
Switch to
[`vite-string-plugin`](https://github.com/silverwind/vite-string-plugin)
to load SVGs as string during tests. The plugin will also be useful once
we switch to vite.
Diffstat (limited to 'vitest.config.js')
-rw-r--r-- | vitest.config.js | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/vitest.config.js b/vitest.config.js index 169a783fdd..0b3a210948 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -1,20 +1,6 @@ import {defineConfig} from 'vitest/dist/config.js'; -import {readFile} from 'node:fs/promises'; -import {dataToEsm} from '@rollup/pluginutils'; -import {extname} from 'node:path'; import vue from '@vitejs/plugin-vue'; - -function stringPlugin() { - return { - name: 'string-plugin', - enforce: 'pre', - async load(id) { - const path = id.split('?')[0]; - if (extname(path) !== '.svg') return null; - return dataToEsm(await readFile(path, 'utf8')); - } - }; -} +import {stringPlugin} from 'vite-string-plugin'; export default defineConfig({ test: { |