|
@ -21,17 +21,27 @@ export function rollup ( entry, options = {} ) { |
|
|
globalName: options.globalName, |
|
|
globalName: options.globalName, |
|
|
|
|
|
|
|
|
// sourcemap options
|
|
|
// sourcemap options
|
|
|
sourceMap: options.sourceMap, |
|
|
sourceMap: !!options.sourceMap, |
|
|
sourceMapFile: options.sourceMapFile, |
|
|
sourceMapFile: options.sourceMapFile, |
|
|
sourceMapRoot: options.sourceMapRoot |
|
|
// sourceMapRoot: options.sourceMapRoot
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
code += `\n//# ${SOURCEMAPPING_URL}=${basename( dest )}.map`; |
|
|
let promises = [ writeFile( dest, code ) ]; |
|
|
|
|
|
|
|
|
return Promise.all([ |
|
|
if ( options.sourceMap ) { |
|
|
writeFile( dest, code ), |
|
|
let url; |
|
|
writeFile( dest + '.map', map.toString() ) |
|
|
|
|
|
]); |
|
|
if ( options.sourceMap === 'inline' ) { |
|
|
|
|
|
url = map.toUrl(); |
|
|
|
|
|
} else { |
|
|
|
|
|
url = `${basename( dest )}.map`; |
|
|
|
|
|
promises.push( writeFile( dest + '.map', map.toString() ) ); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
code += `\n//# ${SOURCEMAPPING_URL}=${url}`; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return Promise.all( promises ); |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|