const path = require('path')

var config = {
  configureWebpack: {
    watch: false,
    entry: {
      app: './src/plugin.js'
    },
    devtool: 'source-map',
    output: {
      library: 'plugin', 
      libraryTarget: 'assign',
      libraryExport: 'default',
      filename: 'app.bundle.js'
      // filename: '[name].js'
    },
    // module: {
    //   rules: [
    //       {
    //           test: /\.(mp4|flv|swf)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
    //           loader: "file-loader",
    //           options: {
    //             name: 'video/[name].[hash:7].[ext]'
    //           }
    //       },
    //       {
    //           test: /\.(gif|jpg|png|woff|svg|eot|ttf)\?.*$/,
    //           loader: 'url-loader?limit=8192'
    //       }
    //   ]
    // },
    externals: {
        vue:'Vue',
        jquery: 'jQuery',
        ['$']: 'jQuery',
        'vue-router': 'VueRouter',
        vuex: 'Vuex',
        iview: 'iview',
        iviewex: 'iviewex',
        xlsx: 'XLSX'
    },
    resolve: {
        alias: {
            '@': path.resolve(__dirname,'src')
        },
        extensions: ['.js', '.vue']
    }
  },
  chainWebpack: config => {
    config.optimization.delete('splitChunks')
    // config.module.rules.delete('svg')
    // config.module.rule('svg-sprite-loader')
    //   .test(/\.svg$/)
    //   .include
    //   .add(path.join(__dirname, '/src/assets/svg'))
    //   .end()
    //   .use('svg-sprite-loader')
    //   .loader('svg-sprite-loader')
    //   .options({
    //     symbolId: 'icon-plugin-[name]'
    //   })

  },
  css: { extract: false }
}

lintOnSave: false,
module.exports = config
