Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run same options transform on generate for bundle #1463

Merged
merged 1 commit into from Jul 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 15 additions & 9 deletions src/rollup.js
Expand Up @@ -44,15 +44,7 @@ const ALLOWED_KEYS = [
'watch'
];

function checkOptions ( options ) {
if ( !options ) {
throw new Error( 'You must supply an options object to rollup' );
}

if ( options.transform || options.load || options.resolveId || options.resolveExternal ) {
throw 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' );
}

function checkAmd ( options ) {
if ( options.moduleId ) {
if ( options.amd ) throw new Error( 'Cannot have both options.amd and options.moduleId' );

Expand All @@ -66,6 +58,18 @@ function checkOptions ( options ) {
console.warn( msg ); // eslint-disable-line no-console
}
}
}

function checkOptions ( options ) {
if ( !options ) {
throw new Error( 'You must supply an options object to rollup' );
}

if ( options.transform || options.load || options.resolveId || options.resolveExternal ) {
throw 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' );
}

checkAmd (options);

const err = validateKeys( keys(options), ALLOWED_KEYS );
if ( err ) throw err;
Expand All @@ -92,6 +96,8 @@ export function rollup ( options ) {
options.format = 'es';
}

checkAmd( options );

timeStart( '--GENERATE--' );

const rendered = bundle.render( options );
Expand Down