import typescript from 'rollup-plugin-typescript2' ; import commonjs from '@rollup/plugin-commonjs' ; import resolve from '@rollup/plugin-node-resolve' ; import json from '@rollup/plugin-json' ; import replace from '@rollup/plugin-replace' ; import type { RollupOptions } from 'rollup' ; import { getGitVersion } from './git-info' ; const options = { input : 'src/index.ts' , output : [ { file : 'build/index.js' , format : 'umd' , name : 'Mocat' , sourcemap : true , } , { file : 'build/index.esm.js' , format : 'esm' } , ] , external : [ ] , plugins : [ typescript ( { tsconfig : './tsconfig.json' , } ) , replace ( Object . entries ( { NODE_ENV : 'production' , VERSION : getGitVersion ( ) , BUILD_DATE : new Date ( ) . toISOString ( ) , CI : process . env . CI || null , } ) . reduce ( ( acc , [ key , value ] ) => ( { ... acc , [ `process.env.${ key }` ] : JSON . stringify ( value ) , } ) , { } ) ) , commonjs ( ) , resolve ( { browser : true , preferBuiltins : false , } ) , json ( ) , ] , } ; export default options ;