Created
December 3, 2017 05:23
-
-
Save wearhere/132a45310c2b5c6a2dacfad467fc814e to your computer and use it in GitHub Desktop.
Minimal Babel setup for use with React "hello world". External dependencies purposefully not handled—see https://mixmax.com/blog/rollup-externals for solutions.
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'; | |
ReactDOM.render( | |
<h1>Hello, world!</h1>, | |
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": "test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "main.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build": "rollup -c" | |
}, | |
"author": "", | |
"license": "MIT", | |
"devDependencies": { | |
"babel-core": "^6.26.0", | |
"babel-preset-react": "^6.24.1", | |
"rollup": "^0.52.0", | |
"rollup-plugin-babel": "^3.0.2" | |
} | |
} |
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 babel from 'rollup-plugin-babel'; | |
export default { | |
input: 'main.js', | |
output: { | |
file: 'bundle.js', | |
format: 'iife' | |
}, | |
plugins: [ | |
babel({ | |
presets: ['react'] | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment