Use a separate Rollup cache for modern output.

This commit is contained in:
Jason Miller 2020-05-07 23:21:15 +00:00
parent f7d231a5df
commit 2bb2a18198

View File

@ -252,7 +252,9 @@ export default async function microbundle(inputOptions) {
let out = await series(
steps.map(config => async () => {
const { inputOptions, outputOptions } = config;
inputOptions.cache = cache;
if (inputOptions.cache !== false) {
inputOptions.cache = cache;
}
let bundle = await rollup(inputOptions);
cache = bundle;
await bundle.write(outputOptions);
@ -498,6 +500,9 @@ function createConfig(options, entry, format, writeMeta) {
let config = {
inputOptions: {
// disable Rollup's cache for the modern build to prevent re-use of legacy transpiled modules:
cache: modern ? false : undefined,
input: entry,
external: id => {
if (id === 'babel-plugin-transform-async-to-promises/helpers') {