Last active
December 27, 2016 08:56
-
-
Save kenmori/f1531b978b980040417eecc9912ff4dd to your computer and use it in GitHub Desktop.
【React】これ。SyntaxError: 'import' and 'export' may only appear at the top level
This file contains hidden or 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
| ///webpack.config.js変更前///// | |
| module: { | |
| loaders: [ | |
| { test: /\.jsx?$/, exclude: /node_modules/, | |
| loaders: ['react-hot'] | |
| } | |
| ] | |
| }, | |
| ///変更後//// | |
| //add 'babel?presets[]=es2015&presets[]=react' | |
| //if you not yet install npmpackage, npm i -D babel-preset-es2015 babel-preset-react | |
| module: { | |
| loaders: [ | |
| { test: /\.jsx?$/, exclude: /node_modules/, | |
| loaders: ['react-hot', 'babel?presets[]=es2015&presets[]=react'] | |
| } | |
| ] | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment