Skip to content

Commit e620d34

Browse files
committed
Switch to vite-string-plugin
1 parent e0a780d commit e620d34

File tree

3 files changed

+12
-39
lines changed

3 files changed

+12
-39
lines changed

package-lock.json

+10-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"devDependencies": {
5656
"@eslint-community/eslint-plugin-eslint-comments": "3.2.1",
5757
"@playwright/test": "1.35.1",
58-
"@rollup/pluginutils": "5.0.2",
5958
"@stoplight/spectral-cli": "6.8.0",
6059
"@vitejs/plugin-vue": "4.2.3",
6160
"eslint": "8.43.0",
@@ -79,6 +78,7 @@
7978
"stylelint-stylistic": "0.4.2",
8079
"svgo": "3.0.2",
8180
"updates": "14.2.8",
81+
"vite-string-plugin": "1.1.0",
8282
"vitest": "0.32.2"
8383
},
8484
"browserslist": [

vitest.config.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
import {defineConfig} from 'vitest/dist/config.js';
2-
import {readFile} from 'node:fs/promises';
3-
import {dataToEsm} from '@rollup/pluginutils';
4-
import {extname} from 'node:path';
52
import vue from '@vitejs/plugin-vue';
6-
7-
function stringPlugin() {
8-
return {
9-
name: 'string-plugin',
10-
enforce: 'pre',
11-
async load(id) {
12-
const path = id.split('?')[0];
13-
if (extname(path) !== '.svg') return null;
14-
return dataToEsm(await readFile(path, 'utf8'));
15-
}
16-
};
17-
}
3+
import {stringPlugin} from 'vite-string-plugin';
184

195
export default defineConfig({
206
test: {

0 commit comments

Comments
 (0)