Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ...
let webpack = require("webpack");
mix.webpackConfig({
plugins: [
// Choose the language you want to keep (Ex: "fr")
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /fr/)
]
});
@vasilegoian
Copy link

vasilegoian commented Mar 16, 2017

For more than one language you can use regex. I haven't tested the code below, but it should work.

let webpack = require("webpack");
mix.webpackConfig({
    plugins: [
      // Choose the language you want to keep (Ex: "fr")
      new webpackContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(fr|en)$/)
    ]
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment