Browse Source

update CLI to handle new warnings

gh-786
Rich-Harris 8 years ago
parent
commit
a44a171dad
  1. 9
      bin/src/runRollup.js

9
bin/src/runRollup.js

@ -60,9 +60,8 @@ export default function runRollup ( command ) {
rollup.rollup({
entry: config,
onwarn: message => {
// TODO use warning codes instead of this hackery
if ( /treating it as an external dependency/.test( message ) ) return;
stderr( message );
if ( message.code === 'UNRESOLVED_IMPORT' ) return;
stderr( message.toString() );
}
}).then( bundle => {
const { code } = bundle.generate({
@ -121,7 +120,7 @@ function execute ( options, command ) {
const optionsExternal = options.external;
if ( command.globals ) {
let globals = Object.create( null );
const globals = Object.create( null );
command.globals.split( ',' ).forEach( str => {
const names = str.split( ':' );
@ -144,7 +143,7 @@ function execute ( options, command ) {
external = ( optionsExternal || [] ).concat( commandExternal );
}
options.onwarn = options.onwarn || stderr;
options.onwarn = options.onwarn || ( warning => stderr( warning.toString() ) );
options.external = external;

Loading…
Cancel
Save