const path = require('path');

function resolve (dir) {
  return path.join(__dirname, dir);
}

module.exports = {
  publicPath: './',
  devServer: {
    // can be overwritten by process.env.HOST
    host: '0.0.0.0',  
    port: 8080
  },
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('src', resolve('src'))
      .set('common', resolve('src/common'))
      .set('components', resolve('src/components'));
  },
  pluginOptions: {
      electronBuilder: {
          builderOptions: {
			  appId: process.env.VUE_APP_ID,
              win: {
                  icon: './public/iscm.ico'
              },
              mac: {
                  icon: './public/iscm.png'
              },
			  productName: 'iSCM',
			  publish: {
				provider: 'generic',
				url: process.env.VUE_APP_API_BASE_URL+'electron'
			  },
			  asar: false,
			  nsis: {
				  "oneClick": false, // 一键安装
				  "allowToChangeInstallationDirectory": true, // 允许修改安装目录
				  'allowElevation': true,
				  'createDesktopShortcut': true,
				  'createStartMenuShortcut': true,
				  'shortcutName': process.env.VUE_APP_PRO_NAME
			  },
          }
      }
  }
};