The babel config and dependencies now match those used by the https://github.com/RedHatInsights/frontend-starter-app. This includes switching the file type of the babel config and cleaning up the babel dependencies.
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
// copied from https://github.com/RedHatInsights/frontend-starter-app/blob/master/babel.config.js
|
|
module.exports = {
|
|
presets: [
|
|
// Polyfills
|
|
'@babel/env',
|
|
// Allow JSX syntax
|
|
'@babel/react',
|
|
],
|
|
plugins: [
|
|
// Put _extends helpers in their own file
|
|
'@babel/plugin-transform-runtime',
|
|
// Support for {...props} via Object.assign({}, props)
|
|
'@babel/plugin-proposal-object-rest-spread',
|
|
// Devs tend to write `import { someIcon } from '@patternfly/react-icons';`
|
|
// This transforms the import to be specific which prevents having to parse 2k+ icons
|
|
// Also prevents potential bundle size blowups with CJS
|
|
[
|
|
'transform-imports',
|
|
{
|
|
'@patternfly/react-icons': {
|
|
transform: (importName) =>
|
|
`@patternfly/react-icons/dist/js/icons/${importName
|
|
.split(/(?=[A-Z])/)
|
|
.join('-')
|
|
.toLowerCase()}`,
|
|
preventFullImport: true,
|
|
},
|
|
},
|
|
'react-icons',
|
|
],
|
|
],
|
|
};
|