const { defineConfig } = require('@vue/cli-service')
const proxy = require('./config/proxy.ts')
const path = require('path')
const { resolve } = require('path')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')

module.exports = defineConfig({
  // publicPath: '',
  transpileDependencies: true,
  devServer: {
    proxy: proxy.dev
  },
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [
        path.resolve(__dirname, '@/src/styes/*.less')
      ]
    }
  },
  chainWebpack: config => {
    config.resolve.alias.set('ThingsUi', resolve(__dirname, '/'))
  },
  configureWebpack: {
    plugins: [
      // new BundleAnalyzerPlugin()
    ]
  },
  css: {
    loaderOptions: {
      less: {
        lessOptions: {
          javascriptEnabled: true
        }
      }
    }
  }
})
