Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Rollup: Explicitly set output.exports (#1326)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan281094 authored Jul 30, 2020
1 parent 571a323 commit ba2bd60
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/core/create_compilers/RollupCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,12 @@ export default class RollupCompiler {
}
});

const resp = await bundle.generate({ format: 'cjs' });
const { code } = resp.output ? resp.output[0] : resp;
const {
output: [{ code }]
} = await bundle.generate({
exports: 'named',
format: 'cjs'
});

// temporarily override require
const defaultLoader = require.extensions['.js'];
Expand All @@ -161,7 +165,7 @@ export default class RollupCompiler {
}
};

const config: any = require(input);
const config: any = require(input).default;
delete require.cache[input];

return config;
Expand Down

0 comments on commit ba2bd60

Please sign in to comment.