@ -2,11 +2,33 @@ import Promise from 'es6-promise/lib/es6-promise/promise.js';
import { basename } from './utils/path.js' ;
import { basename } from './utils/path.js' ;
import { writeFile } from './utils/fs.js' ;
import { writeFile } from './utils/fs.js' ;
import { keys } from './utils/object.js' ;
import { keys } from './utils/object.js' ;
import validateKeys from './utils/validateKeys.js' ;
import SOURCEMAPPING_URL from './utils/sourceMappingURL.js' ;
import SOURCEMAPPING_URL from './utils/sourceMappingURL.js' ;
import Bundle from './Bundle.js' ;
import Bundle from './Bundle.js' ;
export const VERSION = '<@VERSION@>' ;
export const VERSION = '<@VERSION@>' ;
const ALLOWED_KEYS = [
'entry' ,
'dest' ,
'plugins' ,
'external' ,
'onwarn' ,
'indent' ,
'format' ,
'moduleName' ,
'sourceMap' ,
'intro' ,
'outro' ,
'banner' ,
'footer' ,
'globals' ,
'transform' ,
'load' ,
'resolveId' ,
'resolveExternal'
] ;
export function rollup ( options ) {
export function rollup ( options ) {
if ( ! options || ! options . entry ) {
if ( ! options || ! options . entry ) {
return Promise . reject ( new Error ( 'You must supply options.entry to rollup' ) ) ;
return Promise . reject ( new Error ( 'You must supply options.entry to rollup' ) ) ;
@ -16,6 +38,8 @@ export function rollup ( options ) {
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' ) ) ;
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' ) ) ;
}
}
validateKeys ( options , ALLOWED_KEYS ) ;
const bundle = new Bundle ( options ) ;
const bundle = new Bundle ( options ) ;
return bundle . build ( ) . then ( ( ) => {
return bundle . build ( ) . then ( ( ) => {