module.exports = {
  transpileDependencies: [
    'vuetify'
  ],
  css: {
    loaderOptions: {
      sass: {
        additionalData: "@import '~@/assets/scss/variables.scss'"
      },
      scss: {
        implementation: require('sass')
      }
    }
  },
  chainWebpack: (config) => {
    const svgRule = config.module.rule('svg')
    svgRule.uses.clear()
    svgRule
      .use('vue-svg-loader')
      .loader('vue-svg-loader')

    config
      .optimization.splitChunks({
        cacheGroups: {
          default: false,
          vendorStyles: {
            name: 'vendor',
            test (module) {
              return (
                /node_modules/.test(module.context)
                && !/\.css$/.test(module.request)
              )
            },
            chunks: 'all'
          }
        }
      })
  }
}
