Skip to content

Commit e9a9ecc

Browse files
authored
[core] Remove prop-types during build (#2586)
1 parent da85d57 commit e9a9ecc

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"@mui/material": "^5.0.0",
6666
"@mui/styles": "^5.0.0",
6767
"@mui/utils": "^5.0.0",
68+
"@rollup/plugin-babel": "^5.3.0",
6869
"@rollup/plugin-node-resolve": "^13.0.4",
6970
"@rollup/plugin-replace": "^3.0.0",
7071
"@testing-library/react": "^12.1.0",
@@ -84,6 +85,7 @@
8485
"argos-cli": "^0.3.3",
8586
"babel-plugin-module-resolver": "^4.1.0",
8687
"babel-plugin-optimize-clsx": "^2.6.2",
88+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
8789
"babel-plugin-transform-rename-import": "^2.3.0",
8890
"chai": "^4.3.4",
8991
"chai-dom": "^1.9.0",

packages/grid/rollup.data-grid.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import sourceMaps from 'rollup-plugin-sourcemaps';
44
import { terser } from 'rollup-plugin-terser';
55
import dts from 'rollup-plugin-dts';
66
import command from 'rollup-plugin-command';
7+
import babel from '@rollup/plugin-babel';
78
import copy from 'rollup-plugin-copy';
89
import pkg from './data-grid/package.json';
910

@@ -31,6 +32,18 @@ export default [
3132
targets: ['./data-grid/build/'],
3233
}),
3334
typescript({ tsconfig: 'tsconfig.build.json' }),
35+
babel({
36+
babelHelpers: 'bundled',
37+
extensions: ['.tsx'],
38+
plugins: [
39+
[
40+
'transform-react-remove-prop-types',
41+
{
42+
ignoreFilenames: ['DataGrid.tsx'],
43+
},
44+
],
45+
],
46+
}),
3447
!production && sourceMaps(),
3548
production && terser(),
3649
],

packages/grid/rollup.x-grid.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { generateReleaseInfo } from '@mui/x-license-pro';
22
import replace from '@rollup/plugin-replace';
3+
import babel from '@rollup/plugin-babel';
34
import typescript from 'rollup-plugin-typescript2';
45
import cleaner from 'rollup-plugin-cleaner';
56
import sourceMaps from 'rollup-plugin-sourcemaps';
@@ -36,6 +37,18 @@ export default [
3637
targets: ['./x-grid/build/'],
3738
}),
3839
typescript({ tsconfig: 'tsconfig.build.json' }),
40+
babel({
41+
babelHelpers: 'bundled',
42+
extensions: ['.tsx'],
43+
plugins: [
44+
[
45+
'transform-react-remove-prop-types',
46+
{
47+
ignoreFilenames: ['DataGridPro.tsx'],
48+
},
49+
],
50+
],
51+
}),
3952
!production && sourceMaps(),
4053
production && terser(),
4154
],

yarn.lock

+9-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
dependencies:
191191
"@babel/types" "^7.15.4"
192192

193-
"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.13.12", "@babel/helper-module-imports@^7.14.5", "@babel/helper-module-imports@^7.15.4":
193+
"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.13.12", "@babel/helper-module-imports@^7.14.5", "@babel/helper-module-imports@^7.15.4":
194194
version "7.15.4"
195195
resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f"
196196
integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA==
@@ -2621,6 +2621,14 @@
26212621
prop-types "^15.6.1"
26222622
react-lifecycles-compat "^3.0.4"
26232623

2624+
"@rollup/plugin-babel@^5.3.0":
2625+
version "5.3.0"
2626+
resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz#9cb1c5146ddd6a4968ad96f209c50c62f92f9879"
2627+
integrity sha512-9uIC8HZOnVLrLHxayq/PTzw+uS25E14KPUBh5ktF+18Mjo5yK0ToMMx6epY0uEgkjwJw0aBW4x2horYXh8juWw==
2628+
dependencies:
2629+
"@babel/helper-module-imports" "^7.10.4"
2630+
"@rollup/pluginutils" "^3.1.0"
2631+
26242632
"@rollup/plugin-node-resolve@^13.0.4":
26252633
version "13.0.4"
26262634
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.4.tgz#b10222f4145a019740acb7738402130d848660c0"

0 commit comments

Comments
 (0)