Skip to content

Commit e435aae

Browse files
authored
perf: only bundle node version debug (#19715)
1 parent bca89e1 commit e435aae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/vite/rollup.config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { readFileSync } from 'node:fs'
22
import path from 'node:path'
33
import { fileURLToPath } from 'node:url'
4+
import alias from '@rollup/plugin-alias'
45
import nodeResolve from '@rollup/plugin-node-resolve'
56
import commonjs from '@rollup/plugin-commonjs'
67
import json from '@rollup/plugin-json'
@@ -82,6 +83,12 @@ function createSharedNodePlugins({
8283
esbuildOptions?: esbuildOptions
8384
}): Plugin[] {
8485
return [
86+
alias({
87+
entries: {
88+
// we can always use node version (the default entry point has browser support)
89+
debug: 'debug/src/node.js',
90+
},
91+
}),
8592
nodeResolve({ preferBuiltins: true }),
8693
esbuild({
8794
tsconfig: path.resolve(__dirname, 'src/node/tsconfig.json'),

0 commit comments

Comments
 (0)