Skip to content

Instantly share code, notes, and snippets.

@suprith-s-reddy
Created Dec 14, 2020
Embed
What would you like to do?
Vue config
const path = require('path');
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
// const ImageminPlugin = require('imagemin-webpack');
module.exports = {
pluginOptions: {
'style-resources-loader': {
preProcessor: 'scss',
patterns: [path.resolve(__dirname, './src/')]
},
css: { extract: false },
webpackBundleAnalyzer: {
openAnalyzer: false,
analyzerMode: process.env.VUE_APP_BUNDLE_ANALYZER_MODE
}
},
devServer: {
https: true,
},
configureWebpack: {
devtool: 'source-map',
optimization: {
splitChunks: {
chunks: 'all'
}
},
plugins: [
// moment locale plugin for discarding all locale files from moment chunk
// add the locale names in localesToKeep array to keep the required locales
new MomentLocalesPlugin({
localesToKeep: ['en-gb', 'de']
}),
// css compress plugin
new OptimizeCssAssetsPlugin({
cssProcessorPluginOptions: {
preset: ['default', { discardComments: { removeAll: true } }]
}
}),
]
},
chainWebpack: config => {
config.plugins.delete('prefetch');
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment