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

optimize momentjs #11

Open
akshata456 opened this issue Jun 30, 2020 · 1 comment
Open

optimize momentjs #11

akshata456 opened this issue Jun 30, 2020 · 1 comment

Comments

@akshata456
Copy link

Here i used moment :^2.24.0
I want to use specific locals in my code .I used this solution
const webpack = require('webpack');
module.exports = {
//...
plugins: [
// load moment/locale/ja.js and moment/locale/it.js
new webpack.ContextReplacementPlugin(/moment[/\]locale$/, /ja|it/),
],
};
It didn't work for me , it still load other locals also.Please check.Thanks.

@jmblog
Copy link
Owner

jmblog commented Jul 1, 2020

Hi @akshata456,

Can you try to change your webpack config as below?

- new webpack.ContextReplacementPlugin(/moment[/\]locale$/, /ja|it/),
+ new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /ja|it/),

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