Skip to content

Commit

Permalink
Bump vite from 4.5.2 to 5.2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed Jun 12, 2024
1 parent e99aaca commit e7c4bf9
Show file tree
Hide file tree
Showing 3 changed files with 555 additions and 349 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"prettier": "^2.8.7",
"request": "^2.67.0",
"typescript": "^5.0.4",
"vite": "^4.5.2",
"vite": "^5.2.13",
"vite-plugin-favicons-inject": "^2.2.0",
"vitest": "^0.29.8"
"vitest": "^1.6.0"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0",
Expand Down
8 changes: 4 additions & 4 deletions vite.config.ts → vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import {type Plugin, defineConfig, createFilter} from "vite";
import vitePluginFaviconsInject from "vite-plugin-favicons-inject";
import inject from "@rollup/plugin-inject";
import {type ParserBuildOptions, generate} from "peggy";
import peggy from "peggy";

import {readFileSync} from "fs";
import {resolve} from "path";
Expand Down Expand Up @@ -58,7 +58,7 @@ export default defineConfig(() => ({
$: "jquery",
jQuery: "jquery"
}),
peggy(),
peggyPlugin(),
vitePluginFaviconsInject("./turbo.svg")
],
// https://vitest.dev/config/
Expand All @@ -68,14 +68,14 @@ export default defineConfig(() => ({
}
}));

function peggy(options: ParserBuildOptions = {}): Plugin {
function peggyPlugin(options: peggy.ParserBuildOptions = {}): Plugin {
return {
name: "peggy",
transform(grammar, id) {
const {include = ["*.pegjs", "**/*.pegjs"], exclude} = options;
const filter = createFilter(include, exclude);
if (!filter(id)) return null;
const code = generate(grammar, {output: "source", ...options});
const code = peggy.generate(grammar, {output: "source", ...options});
return {
code: `export default ${code};`,
map: {mappings: ""}
Expand Down
Loading

0 comments on commit e7c4bf9

Please sign in to comment.