Skip to content

Commit 8cac924

Browse files
committed
Allow globals to be disabled
1 parent be77fb0 commit 8cac924

File tree

7 files changed

+1041
-52
lines changed

7 files changed

+1041
-52
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ export default defineConfig({
3939
exclude: [
4040
'fs', // Excludes the polyfill for `fs` and `node:fs`.
4141
],
42+
// Whether to polyfill specific globals.
43+
globals: {
44+
Buffer: true, // can also be 'build', 'dev', or false
45+
global: true,
46+
process: true,
47+
},
4248
// Whether to polyfill `node:` protocol imports.
4349
protocolImports: true,
4450
}),

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,21 @@
3131
},
3232
"scripts": {
3333
"build": "vite build && tsc",
34-
"test": "vite -c test/vite.config.ts build && vite -c test/vite.config.ts"
34+
"test": "run-s test:build test:dev",
35+
"test:build": "vite -c test/vite.config.ts build",
36+
"test:dev": "vite -c test/vite.config.ts"
3537
},
3638
"packageManager": "[email protected]",
3739
"devDependencies": {
40+
"@tanstack/react-query": "^4.29.12",
41+
"@tanstack/react-query-devtools": "^4.29.12",
3842
"@types/node": "^18.7.23",
43+
"@vitejs/plugin-react": "^4.0.0",
3944
"esbuild": "^0.16.16",
45+
"npm-run-all": "^4.1.5",
4046
"ohmyfetch": "^0.4.20",
47+
"react": "^18.2.0",
48+
"react-dom": "^18.2.0",
4149
"rollup": "^3.8.1",
4250
"typescript": "4.8.3",
4351
"vite": "^4.0.4",

0 commit comments

Comments
 (0)