Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce bundle size? #142

Open
sneko opened this issue Jul 10, 2020 · 1 comment
Open

Reduce bundle size? #142

sneko opened this issue Jul 10, 2020 · 1 comment

Comments

@sneko
Copy link

sneko commented Jul 10, 2020

Hi @brockpetrie,

There are several ways to not include all locales in the final build bundle with moment.js as described here: https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
(Note that tree-shaking is still not planned for moment.js 😢 )

But I don't know how to manage that since vue-moment is the intermediary.

Any idea?

Thank you,

EDIT: I tried using moment/moment#2517 (comment) but the size has not changed at all. A bit weird ^^... maybe because of the VueMoment intermediary?

@lyokha113
Copy link

You could do the same in vue.config.js
E.g for IgnorePlugin

const webpack = require("webpack");
module.exports = {
  publicPath: "/",
  configureWebpack: {
    plugins: [new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)]
  }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants