123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- const path = require("path");
- const name = "wanda-adm";
- const devServerPort = 28888;
- const stageServerPort = 28889;
- module.exports = {
- // TODO: 更改 publicPath 打包静态文件目录的配置
- publicPath: process.env.NODE_ENV === "production" ? "/" : "/wanda-adm/",
- // TODO:打包名称
- outputDir: "wanda-adm",
- configureWebpack: {
- // module: {
- // rules: [{
- // test: /\.(ttf|otf|eot|woff|woff2)$/,
- // use: {
- // loader: "file-loader",
- // options: {
- // name: " fonts/[name].[ext]",
- // },
- // },
- // },
- // {
- // test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
- // loader: 'url-loader',
- // options: {
- // limit: 10000,
- // name: ('fonts/[name].[ext]')
- // }
- // }]
- // }
- },
- //TODO: eslint 是否在保存时检查
- // assetsDir:'/',
- lintOnSave: process.env.NODE_ENV === "development",
- productionSourceMap: true,
- devServer: {
- port: devServerPort,
- open: true,
- overlay: {
- warning: false,
- errors: true
- },
- progress: false,
- proxy: {
- [process.env.VUE_APP_BASE_API]: {
- target: `http://127.0.0.1:${ stageServerPort }/mock-api/v1`,
- changeOrigin: true, // needed for virtual hosted sites
- ws: true, // proxy websockets
- pathRewrite: {
- ["^" + process.env.VUE_APP_BASE_API]: ""
- }
- },
- "/datacenter": {
- // target: "http://192.168.64.17:28890",
- target: "http://192.168.0.72:8080",
- changeOrigin: true
- },
- "/equip-component": {
- // target: "http://192.168.64.17:28890",
- target: "http://192.168.0.72:8080",
- changeOrigin: true
- },
- "/schedulerapi": {
- // target: "http://192.168.64.17:28890",
- target: "http://192.168.0.72:8080",
- changeOrigin: true,
- pathRewrite: {
- "^/schedulerapi": "/scheduler"
- }
- },
- "/modelapi": {
- // target: "http://192.168.64.17:28890",
- target: "http://192.168.0.72:8080",
- changeOrigin: true,
- pathRewrite: {
- "^/modelapi": "/revit-algorithm"
- }
- },
- // "/modelapi": {
- // target: "http://192.168.0.55:8080",
- // changeOrigin: true,
- // pathRewrite: {
- // "^/modelapi": "/"
- // }
- // },
- "/message-center": {
- // target: "http://192.168.64.17:28890",
- target: "http://192.168.0.72:8080",
- changeOrigin: true
- },
- "/rwd": {
- target: "http://39.102.40.239:9970",
- changeOrigin: true
- },
- "/image-service": {
- target: "http://39.97.179.199:8891",
- changeOrigin: true
- }
- }
- },
- //配置插件
- pluginOptions: {
- "style-resources-loader": {
- preProcessor: "scss",
- // sourceMap: true,
- patterns: [
- path.resolve(__dirname, "src/styles/_variables.scss"),
- path.resolve(__dirname, "src/styles/_mixins.scss")
- ]
- }
- },
- // 高级配置
- chainWebpack(config) {
- // config.module
- // .rule("fonts")
- // .test(/\.(ttf|otf|eot|woff|woff2)$/)
- // .use("file-loader")
- // .loader("file-loader")
- // .tap(options => {
- // options = {
- // // limit: 10000,
- // name: 'fonts/[name].[ext]',
- // }
- // return options
- // })
- // .end()
- //在html网页包插件的选项列表中提供应用程序的标题,以便
- //可以在中访问索引.html插入正确的标题。
- // https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-plugin
- config.plugin("html").tap(args => {
- args[0].title = name;
- return args;
- });
- }
- };
|