import resolve from 'rollup-plugin-node-resolve' ; import commonjs from 'rollup-plugin-commonjs' ; import sourceMaps from 'rollup-plugin-sourcemaps' ; import camelCase from 'lodash.camelcase' ; import typescript from 'rollup-plugin-typescript2' ; import json from 'rollup-plugin-json' ; import replace from '@rollup/plugin-replace' ; import { terser } from 'rollup-plugin-terser' ; const pkg = require ( './package.json' ) ; const libraryName = 'sdk' ; export default { input : `src/${ libraryName }.ts` , output : [ { file : pkg . main , name : camelCase ( libraryName ) , format : 'iife' , sourcemap : false , plugins : [ ] , } , { file : pkg . module , format : 'es' , sourcemap : false , plugins : [ ] , } , ] , external : [ ] , watch : { include : 'src/**' , } , plugins : [ replace ( { preventAssignment : true , values : { 'process.env.ENVIRONMENT' : JSON . stringify ( process . env . ENVIRONMENT ) , } , } ) , json ( ) , typescript ( { useTsconfigDeclarationDir : true } ) , commonjs ( { extensions : [ '.js' , '.ts' ] } ) , resolve ( ) , sourceMaps ( ) , ] , } ;