Last active
April 1, 2016 08:25
-
-
Save vagusX/28758b346063cc89c6cc6ed59cca3876 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
import babel from 'rollup-plugin-babel' | |
import uglify from 'rollup-plugin-uglify' | |
import npm from 'rollup-plugin-npm' | |
import commonjs from 'rollup-plugin-commonjs' | |
import replace from 'rollup-plugin-replace' | |
import json from 'rollup-plugin-json' | |
import inject from 'rollup-plugin-inject' | |
import postcss from 'rollup-plugin-postcss' | |
import autoprefixer from 'autoprefixer' | |
export default { | |
entry: 'src/main.js', | |
dest: 'build/bundle.js', | |
format: 'iife', | |
// external: ['react', 'react-dom'], | |
plugins: [ | |
replace({ | |
'process.env.NODE_ENV': '"development"' | |
}), | |
json(), | |
postcss({ | |
plugins: [ | |
autoprefixer({ browsers: ['last 2 versions'] }) | |
] | |
}), | |
babel({ | |
babelrc: false, | |
exclude: 'node_modules/**', | |
presets: ['es2015-rollup', 'react'] | |
}), | |
npm({ | |
jsnext: true, | |
main: true | |
// builtins: false, | |
// browser: true | |
}), | |
commonjs({ | |
include: 'node_modules/**' | |
// extensions: ['.js', '.coffee'] | |
}), | |
inject({ | |
exclude: 'node_modules/**', | |
modules: { | |
$: 'jquery', | |
Promise: ['es6-promise', 'Promise'] | |
} | |
}) | |
] | |
} |
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' | |
import './style.css' | |
class Hello extends React.Component { | |
render() { | |
return ( | |
<div className='hello'>Hello</div> | |
) | |
} | |
} | |
class App extends React.Component { | |
componentDidMount() { | |
console.log('123') | |
} | |
render() { | |
return ( | |
<div><Hello /> World</div> | |
) | |
} | |
} | |
ReactDOM.render(<App />, document.querySelector('#root')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment