Skip to content

Commit

Permalink
Make Babel a dependency unless bundled
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Jun 19, 2023
1 parent 303b220 commit 31d01ac
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
39 changes: 37 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/govuk-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
},
"devDependencies": {
"@babel/core": "^7.22.5",
"@babel/plugin-transform-runtime": "^7.22.5",
"@babel/preset-env": "^7.22.5",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-replace": "^5.0.2",
Expand All @@ -79,5 +80,8 @@
"govuk-frontend-helpers": "*",
"govuk-frontend-lib": "*",
"govuk-frontend-tasks": "*"
},
"peerDependencies": {
"@babel/runtime": "^7.22.5"
}
}
8 changes: 6 additions & 2 deletions packages/govuk-frontend/rollup.esm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export default defineConfig(({ i: input }) => ({
development: pkg.version
}),
babel({
babelHelpers: 'bundled'
babelHelpers: 'runtime',
plugins: ['@babel/plugin-transform-runtime']
})
]
],

// Keep Babel as a dependency
external: (id) => id.includes('@babel/runtime')
}))

0 comments on commit 31d01ac

Please sign in to comment.