Skip to content

Commit

Permalink
Ignore useless locales from moment.js to reduce bundle size
Browse files Browse the repository at this point in the history
- resolves #14
  • Loading branch information
danielschleindlsperger committed Nov 15, 2017
1 parent e4c4286 commit 74545d9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions webpack.mix.js
@@ -1,5 +1,6 @@
const {mix} = require('laravel-mix');
const { mix } = require('laravel-mix');
const path = require('path');
const webpack = require('webpack');

mix.webpackConfig({
resolve: {
Expand All @@ -9,7 +10,11 @@ mix.webpackConfig({
mixins: path.resolve(__dirname, 'resources/assets/js/mixins'),
repository: path.resolve(__dirname, 'resources/assets/js/repository'),
}
}
},
plugins: [
// reduce bundle size by ignoring most unused locales
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /de|en/)
]
});

mix
Expand Down

0 comments on commit 74545d9

Please sign in to comment.