'webpack设置ico'

This commit is contained in:
hackrobot
2025-03-26 18:15:38 -05:00
parent af9325bfd9
commit d94b011163
6 changed files with 51 additions and 37 deletions

View File

@@ -43,14 +43,23 @@ const config = {
},
},
h5: {
webpackChain (chain) {
webpackChain(chain) {
chain.module
.rule('markdown')
.rule("markdown")
.test(/\.md$/)
.use('raw-loader')
.loader('raw-loader')
.end();
.use("raw-loader")
.loader("raw-loader")
.end();
chain.module
.rule("ico")
.test(/\.ico$/)
.use("file-loader")
.loader("file-loader")
.options({
name: "static/images/[name].[ext]",
});
},
esnextModules: ["taro-ui"],
publicPath: "/",
staticDirectory: "static",
@@ -86,20 +95,20 @@ const config = {
// host: 'nomad.hackrobot.cn', // 替换为您的域名
// port: 10087, // 选择一个适当的端口号
proxy: {
'/api/': {
"/api/": {
target: JSON.parse('"http://localhost:8700"'), //本地调试端口
pathRewrite: {
'^/api/': '/'
"^/api/": "/",
},
changeOrigin: true
}
changeOrigin: true,
},
},
// 允许特定域名访问
allowedHosts: [
// 'bot.hackrobot.cn'
'nomadyt.com'
"nomadyt.com",
],
}
},
},
};