Skip to content

Instantly share code, notes, and snippets.

@rap2hpoutre
Created March 15, 2017 16:04
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rap2hpoutre/a6e84f84f669f3210d54db7bb23d399b to your computer and use it in GitHub Desktop.
Save rap2hpoutre/a6e84f84f669f3210d54db7bb23d399b to your computer and use it in GitHub Desktop.
// ...
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

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