vue.config.js 1.3 KB
Newer Older
wangcong committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
const path = require('path')

var config = {
  configureWebpack: {
    watch: false ,
    entry: {
      app: './src/main.build.js'
    },
    devtool: 'source-map',
    output: {
      library: 'portal_application',
      libraryTarget: 'window',
      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')
  },
qiaoyanqi committed
52 53
  css: { extract: false },
  productionSourceMap: process.env.NODE_ENV === "development" ? true : false
wangcong committed
54 55 56 57
}

lintOnSave: false,
module.exports = config