Created
February 4, 2016 14:35
-
-
Save Eruant/d6f4cb5ba72235eca344 to your computer and use it in GitHub Desktop.
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-rollup", | |
"react" | |
] | |
} |
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 {version} from '../package.json' | |
import React from 'react' | |
export default React.createClass({ | |
render () { | |
return <p>{`The version is ${version}`}</p> | |
} | |
}) |
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": "rollup-test", | |
"version": "0.0.1", | |
"scripts": { | |
"build": "rollup -c" | |
}, | |
"devDependencies": { | |
"babel-preset-es2015-rollup": "1.1.1", | |
"babel-preset-react": "6.3.13", | |
"rollup": "0.25.2", | |
"rollup-plugin-babel": "2.3.9", | |
"rollup-plugin-json": "2.0.0", | |
"rollup-plugin-npm": "1.4.0", | |
"rollup-plugin-uglify": "0.1.0" | |
}, | |
"dependencies": { | |
"react": "0.14.7" | |
} | |
} |
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 json from 'rollup-plugin-json' | |
import babel from 'rollup-plugin-babel' | |
import uglify from 'rollup-plugin-uglify' | |
import npm from 'rollup-plugin-npm' | |
export default { | |
entry: 'src/main.js', | |
format: 'cjs', | |
plugins: [ | |
json(), | |
npm({ | |
buildins: false, | |
browser: true | |
}), | |
babel({ | |
exclude: 'node_modules/**' | |
}), | |
uglify() | |
], | |
dest: 'out-rollup.js' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment