const webpack = require('webpack')
const { defineConfig } = require('@vue/cli-service')

let publicPath = ''
switch (process.env.NODE_ENV) {
case 'development':
  publicPath = '/'
  break
case 'production':
  publicPath = '/one_day_in_southern_song_dynasty/'
  break
default:
  publicPath = '/'
  break
}

module.exports = defineConfig({
  publicPath,
  // transpileDependencies: true,
  configureWebpack: {
    module: {
      rules: [
      ],
    },
    plugins: [
      new webpack.ProvidePlugin({
        utils: ['/src/utils.js', 'default'],
        store: ['/src/store/index.js', 'default'],
        api: ['/src/api.js', 'default'],
        config: '/src/config.js',
        // mapGetters: ['vuex', 'mapGetters'],
      }),
    ],
  },
})
