Skip to content

Commit 3f0c9f2

Browse files
authored
don't bundle preact-* (#73)
1 parent 2478f30 commit 3f0c9f2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bin/build.mjs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import minimist from 'minimist';
33

44
const argv = minimist(process.argv.slice(2));
55

6-
const bundleNodeModules = new Set(['preact', 'preact-render-to-string']);
7-
86
const externalResolverPlugin = {
97
name: 'external-resolver',
108
async setup(build) {
11-
build.onResolve({filter: /.*/}, (args) => {
12-
if (!args.path.startsWith('.') && !bundleNodeModules.has(args.path)) {
13-
return {external: true, path: args.path};
9+
build.onResolve({filter: /.*/}, ({path}) => {
10+
if (!path.startsWith('.')) {
11+
return {external: true, path};
1412
}
1513
});
1614
},

0 commit comments

Comments
 (0)