You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
508 B

3 months ago
  1. /** @type {import('@vue/cli-service').ServicePlugin} */
  2. module.exports = (api, options) => {
  3. api.chainWebpack(webpackConfig => {
  4. if (process.env.NODE_ENV === 'production') {
  5. webpackConfig
  6. .mode('production')
  7. .devtool(options.productionSourceMap ? 'source-map' : false)
  8. // disable optimization during tests to speed things up
  9. if (process.env.VUE_CLI_TEST && !process.env.VUE_CLI_TEST_MINIMIZE) {
  10. webpackConfig.optimization.minimize(false)
  11. }
  12. }
  13. })
  14. }