Skip to content

Commit

Permalink
three shake three.js (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy authored Mar 25, 2024
1 parent 6997e78 commit 7884b5c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scripts/esbuildPlugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const plugins = [
build.onLoad({
filter: /minecraft-data[\/\\]data.js$/,
}, (args) => {
const version = supportedVersions.at(-1);
const version = supportedVersions.at(-1)
if (!version) throw new Error('unreachable')
const data = MCData(version)
const defaultVersionsObj = {
// default protocol data, needed for auto-version
Expand All @@ -47,6 +48,14 @@ const plugins = [
}, () => {
throw new Error('hit banned package')
})

build.onResolve({
filter: /^three$/,
}, async ({ kind, resolveDir }) => {
return {
path: (await build.resolve('three/src/Three.js', { kind, resolveDir })).path,
}
})
}
},
{
Expand Down

0 comments on commit 7884b5c

Please sign in to comment.