text: const path = require('path')
  const webpack = require('webpack')
  const VueLoaderPlugin = require('vue-loader/lib/plugin')
  
  module.exports = {
    entry: './src/AvatarOrInitials.vue',
    plugins: [
      new VueLoaderPlugin()
    ],
    mode: 'development',
    output: {
      path: path.resolve(__dirname, './'),
      publicPath: './',
      filename: 'index.js',
      libraryTarget: 'umd',
      library: '@unicorns/avatars',
      umdNamedDefine: true
    },
    resolve: {
      alias: {
        'vue$': 'vue/dist/vue.esm.js',
        '@': path.resolve(__dirname, 'src')
      }
    },
    module: {
      rules: [
        {
          test: /\.vue$/,
          loader: 'vue-loader'
        },
        {
          test: /\.css$/,
          use: [
            'css-loader'
          ]
        },
        {
          test: /\.js$/,
          loader: 'babel-loader',
          exclude: /node_modules/
        },
        {
          test: /\.(png|jpg|gif|svg)$/,
          loader: 'file-loader',
          options: {
            name: '[name].[ext]?[hash]'
          }
        }
      ]
    },
    devServer: {
      historyApiFallback: true,
      noInfo: true
    },
    performance: {
      hints: false
    },
    devtool: '#eval-source-map'
  }
  
  if (process.env.NODE_ENV === 'production') {
    module.exports.devtool = '#source-map'
    module.exports.mode = 'production'
    // http://vue-loader.vuejs.org/en/workflow/production.html
    module.exports.plugins = (module.exports.plugins || []).concat([
      new webpack.LoaderOptionsPlugin({
        minimize: true
      })
    ])
  }
  
  // test specific setups
  if (process.env.NODE_ENV === 'test') {
    module.exports.externals = [require('webpack-node-externals')()]
    module.exports.devtool = 'eval'
  }
  