Skip to content

Commit 4eb6aae

Browse files
committed
Fix rollup bundling and wrap prop-types
1 parent f8d7feb commit 4eb6aae

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

.babelrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"plugins": [
77
"add-module-exports",
88
"transform-object-rest-spread",
9-
"transform-class-properties"
9+
"transform-class-properties",
10+
["transform-react-remove-prop-types", {
11+
"mode": "wrap"
12+
}]
1013
]
1114
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"babel-plugin-external-helpers": "^6.22.0",
3535
"babel-plugin-transform-class-properties": "^6.23.0",
3636
"babel-plugin-transform-object-rest-spread": "^6.23.0",
37-
"babel-plugin-transform-react-remove-prop-types": "^0.4.1",
37+
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
3838
"babel-preset-env": "^1.3.2",
3939
"babel-preset-react": "^6.23.0",
4040
"enzyme": "^3.3.0",

rollup.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const plugins = [
1616
include: 'node_modules/**',
1717
namedExports: {
1818
'buble/dist/buble.deps': ['transform'],
19+
'buble': ['transform'],
1920
'prismjs/components/prism-core': ['highlight', 'languages']
2021
}
2122
}),
@@ -49,16 +50,17 @@ const prodPlugins = plugins.concat([
4950
]);
5051

5152
const base = {
52-
input: 'src/index.js'
53+
input: 'src/index.js',
54+
external: ['react', 'react-dom', 'prismjs', 'buble']
5355
};
5456

5557
const output = {
5658
exports: 'named',
57-
external: ['react', 'react-dom', 'prismjs'],
5859
globals: {
5960
prismjs: 'Prism',
6061
react: 'React',
61-
'react-dom': 'ReactDOM'
62+
buble: 'Buble',
63+
'react-dom': 'ReactDOM',
6264
}
6365
};
6466

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,9 +1381,9 @@ babel-plugin-transform-react-jsx@^6.23.0:
13811381
babel-plugin-syntax-jsx "^6.8.0"
13821382
babel-runtime "^6.22.0"
13831383

1384-
babel-plugin-transform-react-remove-prop-types@^0.4.1:
1385-
version "0.4.1"
1386-
resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.1.tgz#50d6376d3973c6052087b274ca9bd21b8a07409a"
1384+
babel-plugin-transform-react-remove-prop-types@^0.4.13:
1385+
version "0.4.13"
1386+
resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.13.tgz#331cfc05099a808238311d78319c27460d481189"
13871387

13881388
babel-plugin-transform-regenerator@6.26.0, babel-plugin-transform-regenerator@^6.26.0:
13891389
version "6.26.0"

0 commit comments

Comments
 (0)