Open gmw-web opened 6 years ago
Hi @gmw-web
It looks like you are using the prerelease that isn't quite ready yet.
Can you try using a 2.X version of vue-full-calendar
?
I am indeed using the pre-release. I'd rather not use a 2.x version as this will bloat my build with jQuery.
Having said that;
"...With a stripped down FullCalendar example (no Vue) the issue is not present. It appears to be vue-full-calendar related."
(this is also when using a 4.x version)
I understand that the pre-release isn't really ready yet, but just wanted to give a heads up about the issue and hoped this would be something easily fixable.
You can use this webpack plugin: https://webpack.js.org/plugins/context-replacement-plugin/#usage
In my setup (rails + webpacker), it looks like the following:
const { environment } = require("@rails/webpacker");
const webpack = require("webpack");
environment.plugins.prepend(
"MomentContextReplacement",
new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /nl/),
);
module.exports = environment;
With this code, only the nl
and nl-be
locales are included in my bundle. Hope it can help someone.
(shameless copy+paste from my 'fullcalendar' GitHub issue. With a stripped down FullCalendar example (no Vue) the issue is not present. It appears to be vue-full-calendar related.)
According to the docs on locale...
Expected behaviour:
Without any locales set, only the default locale (English) should be loaded for MomentJS. When loading one or more FullCalendar locale files, the related locale files for MomentJS should get loaded, but only those (no more, no less).
What's happening now:
All locales for MomentJS appear to be loaded regardless.
Details:
I'm using the following in a stripped down example found here:
Futhermore, in the example I cleared the list of events and removed the moment.js import in
App.vue
and I removed the jquery references inwebpack.base.conf.js
.When analyzing the Webpack bundle from this example and even without any locales set for the FullCalendar instance (thus relying on the default English setting), it appears that all locales for MomentJS end up in the final package, resulting in a JavaScript file that's much larger than needed.