Skip to content

Instantly share code, notes, and snippets.

@suprith-s-reddy
Created December 14, 2020 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suprith-s-reddy/76aa63e69aa108d5da36e18cf5097b15 to your computer and use it in GitHub Desktop.
Save suprith-s-reddy/76aa63e69aa108d5da36e18cf5097b15 to your computer and use it in GitHub Desktop.
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