Skip to content

Commit

Permalink
replace require kludge in runRollup.js (#706 - comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Aug 30, 2016
1 parent 93b8a60 commit 3817b74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 3 additions & 4 deletions bin/src/runRollup.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { realpathSync } from 'fs';
import { rollup } from 'rollup';
import relative from 'require-relative';
import handleError from './handleError';
import SOURCEMAPPING_URL from './sourceMappingUrl.js';

const rollup = require( '../dist/rollup.js' ); // TODO make this an import, somehow

import { install as installSourcemapSupport } from 'source-map-support';
installSourcemapSupport();

Expand Down Expand Up @@ -58,7 +57,7 @@ export default function runRollup ( command ) {
config = realpathSync( config );
}

rollup.rollup({
rollup({
entry: config,
onwarn: message => {
if ( /Treating .+ as external dependency/.test( message ) ) return;
Expand Down Expand Up @@ -217,7 +216,7 @@ function bundle ( options ) {
handleError({ code: 'MISSING_INPUT_OPTION' });
}

return rollup.rollup( options ).then( bundle => {
return rollup( options ).then( bundle => {
if ( options.dest ) {
return bundle.write( options );
}
Expand Down
10 changes: 7 additions & 3 deletions rollup.config.cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
buble(),
commonjs({
include: 'node_modules/**',
namedExports: { 'chalk': [ 'red', 'cyan', 'grey' ] }
namedExports: { chalk: [ 'red', 'cyan', 'grey' ] }
}),
nodeResolve({
main: true
Expand All @@ -25,6 +25,10 @@ export default {
'fs',
'path',
'module',
'source-map-support'
]
'source-map-support',
'rollup'
],
paths: {
rollup: '../dist/rollup.js'
}
};

0 comments on commit 3817b74

Please sign in to comment.