ci: add vite-plugin-node-polyfills plugin

This commit is contained in:
Derrick Hammer 2024-03-18 11:37:44 -04:00
parent 42de97519b
commit ed410051e2
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 25 additions and 22 deletions

View File

@ -62,6 +62,7 @@
"tailwindcss": "^3.4.1", "tailwindcss": "^3.4.1",
"typescript": "^5.1.6", "typescript": "^5.1.6",
"vite": "^5.1.0", "vite": "^5.1.0",
"vite-plugin-node-polyfills": "^0.21.0",
"vite-tsconfig-paths": "^4.2.1" "vite-tsconfig-paths": "^4.2.1"
}, },
"engines": { "engines": {

View File

@ -1,27 +1,29 @@
import { vitePlugin as remix } from "@remix-run/dev" import {vitePlugin as remix} from "@remix-run/dev"
import { defineConfig } from "vite" import {defineConfig} from "vite"
import tsconfigPaths from "vite-tsconfig-paths" import tsconfigPaths from "vite-tsconfig-paths"
import {nodePolyfills} from 'vite-plugin-node-polyfills'
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
remix({ remix({
ssr: false, ssr: false,
ignoredRouteFiles: ["**/*.css"] ignoredRouteFiles: ["**/*.css"]
}), }),
tsconfigPaths() tsconfigPaths(),
], nodePolyfills(),
server: { ],
fs: { server: {
// Restrict files that could be served by Vite's dev server. Accessing fs: {
// files outside this directory list that aren't imported from an allowed // Restrict files that could be served by Vite's dev server. Accessing
// file will result in a 403. Both directories and files can be provided. // files outside this directory list that aren't imported from an allowed
// If you're comfortable with Vite's dev server making any file within the // file will result in a 403. Both directories and files can be provided.
// project root available, you can remove this option. See more: // If you're comfortable with Vite's dev server making any file within the
// https://vitejs.dev/config/server-options.html#server-fs-allow // project root available, you can remove this option. See more:
allow: [ // https://vitejs.dev/config/server-options.html#server-fs-allow
"app", allow: [
"node_modules/@fontsource-variable/manrope", "app",
] "node_modules/@fontsource-variable/manrope",
]
}
} }
}
}) })