Skip to content

Instantly share code, notes, and snippets.

@Rich-Harris
Last active February 19, 2016 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Rich-Harris/cd0c293f5263b2450412 to your computer and use it in GitHub Desktop.
Save Rich-Harris/cd0c293f5263b2450412 to your computer and use it in GitHub Desktop.
import React from 'react';
console.log( 'React:', React );
{
"dependencies": {
"react": "^0.14.3"
},
"devDependencies": {
"rollup": "^0.21.2",
"rollup-plugin-commonjs": "^1.4.0",
"rollup-plugin-npm": "^1.1.0",
"rollup-plugin-replace": "^1.1.0"
},
"scripts": {
"build": "rollup -c && open test.html"
}
}
import npm from 'rollup-plugin-npm';
import commonjs from 'rollup-plugin-commonjs';
import replace from 'rollup-plugin-replace';
export default {
entry: 'index.js',
dest: 'bundle.js',
plugins: [
replace({
'process.env.NODE_ENV': '"production"'
}),
npm({
main: true
}),
commonjs({
include: 'node_modules/**'
})
],
format: 'iife'
};
<p>check console</p>
<script src='bundle.js'></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment