Skip to content

Commit

Permalink
fix: Make sure dependencies are external
Browse files Browse the repository at this point in the history
Rollup does check strings for full match, so transforming our dependencies list to RegExp will work even with
imports like `import 'core-js/foo/bar`.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Jun 21, 2023
1 parent ca51f67 commit 1d78f88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion babel.config.js
Expand Up @@ -5,7 +5,7 @@ export default {
"@babel/env",
{
useBuiltIns: "usage",
corejs: "3.0.0",
corejs: "3",
},
],
],
Expand Down
5 changes: 4 additions & 1 deletion rollup.config.js
Expand Up @@ -23,7 +23,10 @@ const packageJson = JSON.parse(
)
)

const externals = [...Object.keys(packageJson?.dependencies || {}), ...Object.keys(packageJson?.peerDependencies || {})]
const externals = [
...Object.keys(packageJson?.dependencies || {}),
...Object.keys(packageJson?.peerDependencies || {})
].map(packageName => new RegExp(`^${packageName}`))

const translations = fs
.readdirSync('./l10n')
Expand Down

0 comments on commit 1d78f88

Please sign in to comment.