Skip to content

Commit

Permalink
fix: treat imported subdirectories/files from packages as external too (
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist authored and Kent C. Dodds committed Feb 12, 2018
1 parent 2909ff4 commit 384ddbe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/config/rollup.config.js
Expand Up @@ -52,6 +52,8 @@ if (isPreact) {
external.splice(external.indexOf('react'), 1)
}

const externalPattern = new RegExp(`^(${external.join('|')})($|/)`)

const esm = format === 'esm'
const umd = format === 'umd'

Expand Down Expand Up @@ -98,7 +100,7 @@ const replacements = Object.entries(
module.exports = {
input,
output,
external,
external: id => externalPattern.test(id),
plugins: [
isNode ? nodeBuiltIns() : null,
isNode ? nodeGlobals() : null,
Expand Down

0 comments on commit 384ddbe

Please sign in to comment.