Skip to content

Commit 7accbad

Browse files
committed
ws fix
1 parent a5db064 commit 7accbad

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

rollup.config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ import alias from '@rollup/plugin-alias';
55
import tsconfigPaths from 'rollup-plugin-tsconfig-paths';
66
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
77
import json from '@rollup/plugin-json';
8+
import { builtinModules } from 'module';
9+
10+
const external = [
11+
'ws',
12+
'isomorphic-ws',
13+
'bufferutil',
14+
'utf-8-validate',
15+
...builtinModules,
16+
];
817

918
const bundle = (
1019
name,
@@ -78,12 +87,13 @@ const bundle = (
7887

7988
{
8089
...baseConfig,
90+
external,
8191
plugins: [
8292
json(),
8393
tsconfigPaths(),
8494
resolve({
8595
extensions: ['.mjs', '.js', '.jsx', '.ts', '.tsx', '.json'],
86-
browser: false,
96+
browser: true,
8797
preferBuiltins: true,
8898
}),
8999
commonjs(),

0 commit comments

Comments
 (0)