text: const fs = require('fs')
  const path = require('path')
  const webpack = require('webpack')
  const config = require('../config/config-lib')
  
  function resolve (dir) {
    return path.join(__dirname, '..', dir)
  }
  
  module.exports = {
    entry: path.resolve(__dirname + '/../src/main.js'),
    output: {
      path: config.build.assetsRoot,
      filename: 'vue-cloud-manager.js',
      libraryTarget: 'umd',
      libraryExport: 'default',
      library: 'vueCloudManager',
      umdNamedDefine: true
    },
    resolve: {
      extensions: ['.js', '.vue', '.json'],
      alias: {
        '@': resolve('src')
      }
    },
    module: {
      rules: [
        {
          test: /\.vue$/,
          loader: 'vue-loader'
        },
        {
          test: /\.js$/,
          loader: 'babel-loader',
          include: [resolve('src'), resolve('test')]
        }
      ]
    },
    plugins: [
      new webpack.optimize.UglifyJsPlugin( {
        minimize : true,
        sourceMap : false,
        mangle: true,
        compress: {
          warnings: false
        }
      })
    ]
  }