terminal:
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
package.json:
"scripts": {
"build": "rollup -c",
"watch": "rollup -cw"
}
rollup.config.js:
import typescript from 'rollup-plugin-typescript'
export default {
entry: './src/index.tsx',
dest: './dist/bundle.js',
format: 'iife',
plugins: [
typescript()
]
}
tsconfig.json:
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"module": "es6",
"moduleResolution": "node",
"noImplicitAny": true,
"outDir": "./dist",
"preserveConstEnums": true,
"target": "es5"
},
"exclude": [
"node_modules"
]
}
See new rollup config here: https://github.com/rollup/rollup-plugin-typescript
UPDATE: i mean here: https://github.com/rollup/plugins/tree/master/packages/typescript (it moved again)