Skip to content

Instantly share code, notes, and snippets.

@vagusX
Forked from Rich-Harris/index.js
Created January 20, 2016 07:40
Show Gist options
  • Save vagusX/1c3070b4b83887d7550f to your computer and use it in GitHub Desktop.
Save vagusX/1c3070b4b83887d7550f 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