@@ -18,6 +18,7 @@ import brotliSize from 'brotli-size';
1818import prettyBytes from 'pretty-bytes' ;
1919import shebangPlugin from 'rollup-plugin-preserve-shebang' ;
2020import typescript from 'rollup-plugin-typescript2' ;
21+ import json from 'rollup-plugin-json' ;
2122import flow from './lib/flow-plugin' ;
2223import logError from './log-error' ;
2324import { readFile , isDir , isFile , stdout , stderr } from './utils' ;
@@ -238,7 +239,6 @@ function createConfig(options, entry, format, writeMeta) {
238239 aliases [ '.' ] = './' + basename ( options . output ) ;
239240 }
240241
241- let useNodeResolve = true ;
242242 const peerDeps = Object . keys ( pkg . peerDependencies || { } ) ;
243243 if ( options . external === 'none' ) {
244244 // bundle everything (external=[])
@@ -350,6 +350,15 @@ function createConfig(options, entry, format, writeMeta) {
350350 inject : false ,
351351 extract : ! ! writeMeta ,
352352 } ) ,
353+ nodeResolve ( {
354+ module : true ,
355+ jsnext : true ,
356+ browser : options . target !== 'node' ,
357+ } ) ,
358+ commonjs ( {
359+ include : 'node_modules/**' ,
360+ } ) ,
361+ json ( ) ,
353362 useTypescript &&
354363 typescript ( {
355364 typescript : require ( 'typescript' ) ,
@@ -419,16 +428,6 @@ function createConfig(options, entry, format, writeMeta) {
419428 dangerousTaggedTemplateString : true ,
420429 } ,
421430 } ) ,
422- useNodeResolve &&
423- commonjs ( {
424- include : 'node_modules/**' ,
425- } ) ,
426- useNodeResolve &&
427- nodeResolve ( {
428- module : true ,
429- jsnext : true ,
430- browser : options . target !== 'node' ,
431- } ) ,
432431 // We should upstream this to rollup
433432 // format==='cjs' && replace({
434433 // [`module.exports = ${rollupName};`]: '',
0 commit comments