Created
January 2, 2017 10:55
-
-
Save cowchimp/fd1f2d19ba55997d371e861d09ddd76f to your computer and use it in GitHub Desktop.
Trying to understand why `transform-decorators-legacy` isn't working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
"es2015", | |
"react" | |
], | |
"plugins": [ | |
"syntax-decorators", | |
"transform-decorators-legacy" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function foo(a) { | |
console.log(a); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { foo } from './foo'; | |
@foo('/') //if i comment this out then everything works | |
class HomePage extends Component { | |
render() { | |
return ( | |
<div> | |
<h1>Hello World</h1> | |
</div> | |
) | |
} | |
} | |
export default HomePage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>React Webpack template</title> | |
</head> | |
<body> | |
<div id="root">If you see this then something is wrong.</div> | |
<script src="dist/browser-bundle.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import HomePage from './HomePage'; | |
ReactDOM.render(<HomePage />, document.getElementById('root')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "react-webpack-template", | |
"version": "0.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "webpack --progress --colors --watch", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "BSD-2-Clause", | |
"dependencies": { | |
"react": "^0.14.5", | |
"react-dom": "^0.14.5" | |
}, | |
"devDependencies": { | |
"babel-cli": "^6.18.0", | |
"babel-core": "^6.3.26", | |
"babel-loader": "^6.2.0", | |
"babel-plugin-syntax-decorators": "^6.13.0", | |
"babel-plugin-transform-decorators-legacy": "^1.3.4", | |
"babel-preset-es2015": "^6.3.13", | |
"babel-preset-react": "^6.3.13", | |
"webpack": "^1.12.9" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: './index', | |
output: { | |
filename: 'dist/browser-bundle.js' | |
}, | |
devtool: 'source-map', | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
loader: 'babel-loader' | |
}, | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment