Skip to content

Commit 59ad11f

Browse files
committed
Add transform plugin babel to demo
1 parent d8b2a1e commit 59ad11f

File tree

4 files changed

+27
-16
lines changed

4 files changed

+27
-16
lines changed

packages/react-renderer-demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@mdx-js/react": "^1.4.5",
3232
"@next/mdx": "^9.1.2",
3333
"@patternfly/patternfly-next": "^1.0.175",
34-
"@patternfly/react-core": "~3.16.10",
34+
"@patternfly/react-core": "~3.129.3",
3535
"@patternfly/react-tokens": "^2.5.1",
3636
"brace": "^0.11.1",
3737
"clsx": "^1.0.4",

packages/react-renderer-demo/src/app/.babelrc

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const createIconsTransformPlugin = [
2+
'transform-imports',
3+
{
4+
'@patternfly/react-icons': {
5+
transform: (importName) =>
6+
`@patternfly/react-icons/dist/js/icons/${importName.split(/(?=[A-Z])/).join('-').toLowerCase()}`,
7+
preventFullImport: true,
8+
},
9+
},
10+
];
11+
12+
module.exports = {
13+
presets: [
14+
[
15+
'next/babel',
16+
{
17+
'transform-runtime': {
18+
useESModules: false,
19+
},
20+
},
21+
],
22+
],
23+
plugins: [ createIconsTransformPlugin ],
24+
};

packages/react-renderer-demo/src/app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@
5858
"@mdx-js/react": "^1.4.5",
5959
"@next/mdx": "^9.0.5",
6060
"@patternfly/patternfly-next": "^1.0.175",
61-
"@patternfly/react-core": "~3.16.10",
61+
"@patternfly/react-core": "~3.129.3",
6262
"@patternfly/react-tokens": "^2.5.1",
63+
"babel-plugin-transform-imports": "^2.0.0",
6364
"brace": "^0.11.1",
6465
"clsx": "^1.0.4",
6566
"docsearch.js": "^2.6.3",

0 commit comments

Comments
 (0)