You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
const webpack = require("webpack");
|
|
const path = require("path");
|
|
|
|
const port = process.env.port || process.env.npm_config_port || 80; // 端口
|
|
module.exports = {
|
|
//打包的路径 publicPath: ./ 是争对hash路径的 /是history的
|
|
publicPath: "./",
|
|
// 将构建好的文件输出到哪里 文件夹名
|
|
outputDir: "dist",
|
|
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
|
productionSourceMap: false,
|
|
// webpack-dev-server 相关配置
|
|
devServer: {
|
|
host: "localhost",
|
|
port: 8080,
|
|
open: false,
|
|
proxy: {
|
|
[process.env.VUE_APP_BASE_API]: {
|
|
target: "http://wallet-chaindata-api.weirui0755.com/",
|
|
changeOrigin: true,
|
|
// pathRewrite: {
|
|
// ['^' + process.env.VUE_APP_BASE_API]: ''
|
|
// }
|
|
},
|
|
},
|
|
disableHostCheck: true,
|
|
},
|
|
// 配置插件参数
|
|
configureWebpack: {
|
|
plugins: [
|
|
// 配置 jQuery 插件的参数
|
|
new webpack.ProvidePlugin({
|
|
$: "jquery",
|
|
jQuery: "jquery",
|
|
"window.jQuery": "jquery",
|
|
Popper: ["popper.js", "default"],
|
|
}),
|
|
],
|
|
},
|
|
pluginOptions: {
|
|
// 全局引入的less文件
|
|
"style-resources-loader": {
|
|
preProcessor: "less",
|
|
patterns: [],
|
|
},
|
|
},
|
|
};
|