Skip to content

Commit

Permalink
Mark Three as dep/external of packages
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed Jun 18, 2021
1 parent 4ca8544 commit 4315909
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions packages/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getConfig(pkg) {
libraryTarget: 'commonjs2',
},
externals: Object.fromEntries(
['react', 'react-dom', '@react-three/fiber'].map((dep) => [
['react', 'react-dom', '@react-three/fiber', 'three'].map((dep) => [
dep,
`commonjs2 ${dep}`,
])
Expand Down Expand Up @@ -88,21 +88,19 @@ function getConfig(pkg) {
}),
new JsonPostProcessPlugin({
// Add H5Web's R3F dependency to @h5web/lib's `package.json`
matchers:
pkg === 'lib'
? [
{
matcher: /^package\.json$/u,
action: (json) => ({
...json,
dependencies: {
'@react-three/fiber':
rootPkg.dependencies['@react-three/fiber'],
},
}),
},
]
: [],
matchers: [
{
matcher: /^package\.json$/u,
action: (json) => ({
...json,
dependencies: {
'@react-three/fiber':
rootPkg.dependencies['@react-three/fiber'],
three: rootPkg.dependencies['three'],
},
}),
},
],
}),
],
stats: {
Expand Down

0 comments on commit 4315909

Please sign in to comment.