Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
react + rollup + typescript boilerplate


npm i --save-dev rollup rollup-watch rollup-plugin-typescript typescript typings
npm i -S react react-dom
./node_modules/.bin/typings install react react-dom --save
mkdir src dist
touch src/index.tsx


"scripts": {
  "build": "rollup -c",
  "watch": "rollup -cw"


import typescript from 'rollup-plugin-typescript'

export default {
  entry: './src/index.tsx',
  dest: './dist/bundle.js',
  format: 'iife',
  plugins: [


  "compilerOptions": {
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "forceConsistentCasingInFileNames": true,
    "jsx": "react",
    "module": "es6",
    "moduleResolution": "node",
    "noImplicitAny": true,
    "outDir": "./dist",
    "preserveConstEnums": true,
    "target": "es5"
  "exclude": [
Copy link

krokofant commented Oct 7, 2016

Thanks! This was helpful in getting up and running. Simple and elegant 👍

Copy link

krokofant commented Oct 7, 2016

What is the point of installing typescript? rollup uses the one that comes with rollup-plugin-typescript which is 1.8.9 as of now.

Copy link

SeanJM commented Oct 18, 2016

There's a new version of TypeScript (2.0), another reason for installing it is so you can specify the local installation of 2.0.

Copy link

mattd-rs commented Aug 29, 2019

This doesn't work out of the box anymore due to new versions of these packages. Consider adding version numbers of what will work.

Copy link

rek commented Sep 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment