Skip to content

Commit fc4b461

Browse files
feat(calendar-web): add Rollup configuration for modern client support
1 parent 7bb76ff commit fc4b461

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import commonjs from "@rollup/plugin-commonjs";
2+
3+
export default args => {
4+
const result = args.configDefaultConfig;
5+
return result.map(config => {
6+
config.output.inlineDynamicImports = true;
7+
if (config.output.format !== "es") {
8+
return config;
9+
}
10+
return {
11+
...config,
12+
plugins: [
13+
...config.plugins.map(plugin => {
14+
if (plugin && plugin.name === "commonjs") {
15+
// replace common js plugin that transforms
16+
// external requires to imports
17+
// this is needed in order to work with modern client
18+
return commonjs({
19+
extensions: [".js", ".jsx", ".tsx", ".ts"],
20+
transformMixedEsModules: true,
21+
requireReturnsDefault: "auto",
22+
esmExternals: true
23+
});
24+
}
25+
26+
return plugin;
27+
})
28+
]
29+
};
30+
});
31+
};

0 commit comments

Comments
 (0)