import { InputOptions , OutputOptions , RollupPlugin } from '@balm-core/index' ; function getInputPlugins ( customInputOptions ) { const { inputOptions } = BalmJS . config . scripts ; const inputPlugins = [ ] ; if ( inputOptions . plugins ) { inputPlugins . push ( ... ( inputOptions . plugins as RollupPlugin [ ] ) ) ; } if ( customInputOptions . plugins ) { inputPlugins . push ( ... ( customInputOptions . plugins as RollupPlugin [ ] ) ) ; } return inputPlugins ; } function getOutputPlugins ( customOutputOptions ) { const { outputOptions } = BalmJS . config . scripts ; const outputPlugins = [ ] ; if ( outputOptions . plugins ) { outputPlugins . push ( ... ( outputOptions . plugins as RollupPlugin [ ] ) ) ; } if ( BalmJS . config . env . isProd ) { outputPlugins . push ( require ( 'rollup-plugin-terser' ) . terser ( BalmJS . config . scripts . minifyOptions ) ) ; } if ( customOutputOptions . plugins ) { outputPlugins . push ( ... ( customOutputOptions . plugins as RollupPlugin [ ] ) ) ; } return outputPlugins ; } export { getInputPlugins , getOutputPlugins } ;