You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within an existing project which uses webpack, yarn and moment.js, I recently added vue-moment as a dependency. Using webpack's bundle analysis, I quickly saw that the size of vue-moment was as big as moment itself.
I believe this to be occurring because webpack auto-resolves the import of vue-moment by examing the file node_modules/vue-moment/package.json. This file contains an entry for "main" which points to the copy of vue-moment.js within the dist folder, which continues to have the moment code "inline" (and does not match up with the conditional inclusion present within the node_modules/vue-moment/vue-moment.js file.
{
"name": "vue-moment",
"version": "4.0.0",
"description": "Handy Moment.js filters for your Vue.js project",
"main": "dist/vue-moment.js",
I also have this issue, and believe this behavior should be fixed in vue-moment.
For me, setting the alias to to the ES module node_modules/vue-moment/dist/vue-moment.es.js allowed my configuration to import the moment code only once and keep the vue-moment slice small with only one step. (No need for deduplication.)
Within an existing project which uses webpack, yarn and moment.js, I recently added vue-moment as a dependency. Using webpack's bundle analysis, I quickly saw that the size of vue-moment was as big as moment itself.
I believe this to be occurring because webpack auto-resolves the import of
vue-moment
by examing the filenode_modules/vue-moment/package.json
. This file contains an entry for "main" which points to the copy of vue-moment.js within the dist folder, which continues to have the moment code "inline" (and does not match up with the conditional inclusion present within thenode_modules/vue-moment/vue-moment.js
file.While I can resolve this using a combination of:
yarn-deduplicate
)I don't believe I should have to do this in order to minimize the footprint of vue-moment in my production bundle.
Have I discovered an issue or is this intentional by design?
The text was updated successfully, but these errors were encountered: