'use strict'; const path = require('path'); function resolve(dir) { return path.join(__dirname, dir) } // If your port is set to 80, // use administrator privileges to execute the command line. // For example, Mac: sudo npm run // You can change the port by the following method: // port = 9518 npm run dev OR npm run dev --port = 9518 const port = process.env.port || process.env.npm_config_port || 9518; // dev port // All configuration item explanations can be find in https://cli.vuejs.org/config/ module.exports = { /** * You will need to set publicPath if you plan to deploy your site under a sub path, * for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/, * then publicPath should be set to "/bar/". * In most cases please use '/' !!! * Detail: https://cli.vuejs.org/config/#publicpath */ // publicPath: '/', publicPath: './', outputDir: 'dist', assetsDir: './static', lintOnSave: false, indexPath: './index.html', productionSourceMap: false, devServer: { port: port, open: true, overlay: { warnings: false, errors: true }, proxy: { '/apo': { target: 'http://localhost:8090', changeOrigin: true, pathRewrite: {} }, '/ws': { target: 'http://localhost:8090', ws: true, changeOrigin: true, pathRewrite: { '^/ws' : '' } }, }, // before: require('./mock/mock-server.js') }, transpileDependencies: [/node_modules[/\\\\](element-ui|vuex|vue-baidu-map|)[/\\\\]/], // 默认情况下 babel-loader 会忽略所有 node_modules 中的文件。如果你想要通过 Babel 显式转译一个依赖,可以在 transpileDependencies 选项中列出来。 };