Skip to content

Commit 0636263

Browse files
committed
create rollup config for processing polyfills
1 parent 687703b commit 0636263

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// TODO: Swich out the sucrase hack for the real, currently-commented-out code once we switch sucrase builds on.
2+
3+
// export default ['esm', 'cjs'].map(format => ({
4+
export default ['esm', 'cjs'].map(format => {
5+
const config = {
6+
input: '../../rollup/jsPolyfills/index.js',
7+
output: {
8+
// preserveModules: true,
9+
dir: `jsPolyfills/${format}`,
10+
format,
11+
strict: false,
12+
},
13+
};
14+
// }));
15+
16+
// temporary hack for testing sucrase bundles before we switch over
17+
if (!process.version.startsWith('v8')) {
18+
// eslint-disable-next-line no-console
19+
console.log('Doing normal preserveModules in polyfill config');
20+
config.output.preserveModules = true;
21+
} else {
22+
// eslint-disable-next-line no-console
23+
console.log('Doing node 8 preserveModules in polyfill config');
24+
config.preserveModules = true;
25+
}
26+
27+
return config;
28+
});

0 commit comments

Comments
 (0)