代码拉取完成,页面将自动刷新
/**
* @Author: SYQ
* @Date: 2022-2-15 00:33:19
*/
"use strict";
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const resolve = (dir) => {
return path.resolve(__dirname, dir);
};
module.exports = {
publicPath: "./",
outputDir: "dist",
productionSourceMap: false,
lintOnSave: true,
devServer: {
open: true,
host: "0.0.0.0",
// public: "192.168.55.96:8020",
hotOnly: true,
port: 8020,
proxy: {
"/api": {
target: "http://192.168.1.208:1010",
changeOrigin: true
// pathRewrite: {
// "^/api": ""
// }
}
}
},
configureWebpack: {
externals: {
// jquery: "jQuery"
},
resolve: {
alias: {
vue$: "vue/dist/vue.esm.js",
"@": path.resolve(__dirname, "./src"),
"@xgismaps": path.resolve(__dirname, "./xgismap-sdk/dist")
},
extensions: ["*", ".js", ".vue", ".json"]
},
module: {
unknownContextCritical: false
},
performance: {
hints: false
}
},
chainWebpack: (config) => {
config.resolve.extensions
.add(".js")
.add(".vue")
.end();
config.module
.rule("images")
.test(/\.(png|jpe?g|gif)(\?.*)?$/)
.use("url-loader")
.loader("url-loader")
.options({
name: "images/[name].[ext]",
limit: 10000,
esModule: false
})
.end();
config.module
.rule("fonts")
.test(/\.(eot|ttf|TTF|woff|woff2|otf)(\?.*)?$/)
.use("url-loader")
.loader("url-loader")
.options({
name: "fonts/[name].[ext]",
limit: 10000
})
.end();
config.module
.rule("svg")
.exclude.add(resolve("src/assets/svg/icons"))
.end();
config.module
.rule("icons")
.test(/\.svg$/)
.include.add(resolve("src/assets/svg/icons"))
.end()
.use("svg-sprite-loader")
.loader("svg-sprite-loader")
.options({
symbolId: "icon-[name]"
})
.end();
config.plugin("copy").use(CopyWebpackPlugin, [
[
{
from: path.join(__dirname, "public"),
to: path.join(__dirname, "dist")
},
{
from: path.join(__dirname, "xgismap-sdk/dist/resources"),
to: path.join(__dirname, "dist", "libs/xgismaps-sdk/resources")
}
]
]);
}
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。