Skip to content

Commit

Permalink
Add babel-plugin-react-display-name. Should preserve displayName when…
Browse files Browse the repository at this point in the history
… using React.createComponent. Fix #18.
  • Loading branch information
sapegin committed Nov 9, 2015
1 parent 2935eca commit 056b160
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"dependencies": {
"babel-core": "5.8.30",
"babel-loader": "5.3.2",
"babel-plugin-react-display-name": "~2.0.0",
"babel-plugin-react-transform": "1.1.1",
"chalk": "1.1.1",
"codemirror": "5.8.0",
Expand Down
7 changes: 6 additions & 1 deletion src/make-webpack-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ module.exports = function(env) {
}

var reactTransformPath = path.join(__dirname, '../../babel-plugin-react-transform'); // npm 3
var reactDisplayNamePath = path.join(__dirname, '../../babel-plugin-react-display-name'); // npm 3
if (!fs.existsSync(reactTransformPath)) {
reactTransformPath = path.resolve(__dirname, '../node_modules/babel-plugin-react-transform'); // npm 2 or react-styleguidist develop
reactDisplayNamePath = path.resolve(__dirname, '../node_modules/babel-plugin-react-display-name'); // npm 2 or react-styleguidist develop
}

var includes = [
Expand Down Expand Up @@ -146,7 +148,10 @@ module.exports = function(env) {
loader: 'babel',
query: {
stage: 0,
plugins: [reactTransformPath],
plugins: [
reactDisplayNamePath,
reactTransformPath
],
extra: {
'react-transform': {
transforms: [
Expand Down

0 comments on commit 056b160

Please sign in to comment.