Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function rollup ( options ) {
if ( !options || !options.entry ) {
return Promise.reject( new Error( 'You must supply options.entry to rollup' ) );
}
if ( options.transform || options.load || options.resolveId || options.resolveExternal ) {
return Promise.reject( new Error( 'The `transform`, `load`, `resolveId` and `resolveExternal` options are deprecated in favour of a unified plugin API. See https://github.com/rollup/rollup/wiki/Plugins for details' ) );
}
const error = validateKeys( options, ALLOWED_KEYS );
if ( error ) {
return Promise.reject( error );
}
const bundle = new Bundle( options );
return bundle.build().then( () => {
return {
imports: bundle.externalModules.map( module => module.id ),
exports: keys( bundle.entryModule.exports ),
modules: bundle.orderedModules.map( module => {
return { id: module.id };
export function rollup ( options ) {
if ( !options || !options.entry ) {
return Promise.reject( new Error( 'You must supply options.entry to rollup' ) );
}
if ( options.transform || options.load || options.resolveId || options.resolveExternal ) {
return Promise.reject( new Error( 'The `transform`, `load`, `resolveId` and `resolveExternal` options are deprecated in favour of a unified plugin API. See https://github.com/rollup/rollup/wiki/Plugins for details' ) );
}
const error = validateKeys( options, ALLOWED_KEYS );
if ( error ) {
return Promise.reject( error );
}
const bundle = new Bundle( options );
return bundle.build().then( () => {
return {
imports: bundle.externalModules.map( module => module.id ),
exports: keys( bundle.entryModule.exports ),
modules: bundle.orderedModules.map( module => {
return { id: module.id };
}),
generate: options => bundle.render( options ),
write: options => {
if ( !options || !options.dest ) {
throw new Error( 'You must supply options.dest to bundle.write' );