importresolvefrom'rollup-plugin-node-resolve'importcommonjsfrom'rollup-plugin-commonjs'importsourceMapsfrom'rollup-plugin-sourcemaps'importcamelCasefrom'lodash.camelcase'importtypescriptfrom'rollup-plugin-typescript2'importjsonfrom'rollup-plugin-json'constpkg=require('./package.json')constlibraryName='rctest'exportdefault{input:`src/${libraryName}.ts`,output:[{file:pkg.main,name:camelCase(libraryName),format:'umd',sourcemap:true},{file:pkg.module,format:'es',sourcemap:true},],// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')external:[],watch:{include:'src/**',},plugins:[// Allow json resolutionjson(),// Compile TypeScript filestypescript({useTsconfigDeclarationDir:true}),// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)commonjs(),// Allow node_modules resolution, so you can use 'external' to control// which external modules to include in the bundle// https://github.com/rollup/rollup-plugin-node-resolve#usageresolve(),// Resolve source maps to the original sourcesourceMaps(),],}