Skip to content

Commit

Permalink
shrink bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
escoand committed Feb 1, 2023
1 parent 3ee8c9b commit 602ef85
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/caldav.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/caldav.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/multicol.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/multicol.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/yearview.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/yearview.js.map

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,29 @@ import serve from "rollup-plugin-serve";

const extensions = [".js", ".jsx", ".ts", ".tsx"];

const globals = {
"@fullcalendar/core": "FullCalendar",
"@fullcalendar/core/internal": "FullCalendar.Internal",
"@fullcalendar/core/preact": "FullCalendar.Preact",
};

const plugins = [
resolve({ extensions }),
commonjs(),
babel({
babelHelpers: "bundled",
exclude: [/\/core-js\//],
extensions,
presets: [
"@babel/preset-typescript",
[
"@babel/preset-env",
{
corejs: "3.27",
useBuiltIns: "usage",
useBuiltIns: "entry",
},
],
],
targets: "defaults",
}),
css({ minify: true }),
terser(),
Expand All @@ -32,11 +38,13 @@ const plugins = [
];

const createOutput = (input, name) => ({
external: Object.keys(globals),
input,
output: {
compact: true,
dir: "dist/",
format: "iife",
globals,
name,
sourcemap: true,
},
Expand Down
5 changes: 3 additions & 2 deletions samples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@
name: "Demo",
},
],
height: "100%",
plugins: [CalDavPlugin, MultiColumnPlugin, YearViewPlugin],
headerToolbar: {
center: "title",
left: "prev,next today",
right:
"multiCol,yearView listWeek,timeGridWeek,dayGridWeek,dayGridMonth,multiMonthYear",
},
height: "100%",
plugins: [CalDavPlugin, MultiColumnPlugin, YearViewPlugin],
weekNumbers: true,
});
cal.render();
</script>

1 comment on commit 602ef85

@vercel
Copy link

@vercel vercel bot commented on 602ef85 Feb 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.