const CopyWebpackPlugin = require('copy-webpack-plugin')
const copyToApps = require('./copyToApps')
const path = require('path')
function resolve (dir) {
    return path.resolve(__dirname, '../', dir)
}

module.exports = {
  mode: 'development',
  watch: true,
  entry: 'index.js',

  output: {
    path: resolve('.tmp'),
    filename: '[name].js'
  },
  plugins: [
    new CopyWebpackPlugin([
      ...copyToApps('components'),
      ...copyToApps('apis'),
      ...copyToApps('utils'),
      ...copyToApps('config'),
      ...copyToApps('im', true)
    ])
  ]
}