-
-
Save suprith-s-reddy/76aa63e69aa108d5da36e18cf5097b15 to your computer and use it in GitHub Desktop.
Vue config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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