vite-poly

This commit is contained in:
Untone 2024-05-02 01:24:03 +03:00
parent 7896950ec8
commit 2500206a9d
4 changed files with 1158 additions and 25 deletions

1165
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -131,6 +131,7 @@
"vike": "0.4.148",
"vite": "5.2.10",
"vite-plugin-mkcert": "^1.17.3",
"vite-plugin-node-polyfills": "0.21.0",
"vite-plugin-sass-dts": "^1.3.17",
"vite-plugin-solid": "2.10.1",
"y-prosemirror": "1.2.2",

View File

@ -4,6 +4,5 @@
"source": "/((?!assets/).*)",
"destination": "/api/edge-ssr.js"
}
],
"nodeVersion": "20"
]
}

View File

@ -1,6 +1,7 @@
import ssrPlugin from 'vike/plugin'
import { defineConfig } from 'vite'
import mkcert from 'vite-plugin-mkcert'
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import sassDts from 'vite-plugin-sass-dts'
import solidPlugin from 'vite-plugin-solid'
@ -39,6 +40,19 @@ export default defineConfig(({ mode, command }) => {
ssrPlugin({ includeAssetsImportedByServer: true }),
sassDts(),
cssModuleHMR(),
nodePolyfills({
include: ['path', 'stream', 'util'],
exclude: ['http'],
globals: {
Buffer: true,
//global: true,
//process: true,
},
overrides: {
fs: 'memfs',
},
protocolImports: true,
}),
]
if (command === 'serve') {