From bfebed2a2c25b6e7f0a7726afee03158049a5187 Mon Sep 17 00:00:00 2001 From: hackrobot Date: Thu, 26 Sep 2024 08:43:29 +0800 Subject: [PATCH] =?UTF-8?q?feat::=E8=87=AA=E5=AE=9A=E4=B9=89=E8=B7=AF?= =?UTF-8?q?=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 43 +++++++++++++++++++++++-------------------- src/app.config.js | 2 -- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/config/index.js b/config/index.js index eaa55a3..3be403c 100644 --- a/config/index.js +++ b/config/index.js @@ -42,14 +42,15 @@ 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(); }, + esnextModules: ["taro-ui"], publicPath: "/", staticDirectory: "static", @@ -66,17 +67,19 @@ const config = { }, }, }, - // customRoutes: { - // // "页面路径": "自定义路由" - // "/pages/index/index": "/index", - // // '/pages/detail/index': ['/detail'], // 可以通过数组为页面配置多个自定义路由 - // "pages/my/index": "/my", - // "pages/meetup/index": "/meetup", - // "pages/meetup/Detail/index": "/detail", - // }, + router: { // basename: '/myapp', - mode: "hash", // 或者是 'browser' + // mode: "hash", // 或者是 'browser' + mode: "browser", // 或者是 'browser' + customRoutes: { + // "页面路径": "自定义路由" + "/pages/index/index": "/", + // '/pages/detail/index': ['/detail'], // 可以通过数组为页面配置多个自定义路由 + "pages/my/index": "/my", + "pages/meetup/index": "/meetup", + "pages/meetup/Detail/index": "/detail", + }, }, // defineConstants: { // HOST: '"/api"' @@ -85,20 +88,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' - "www.digitalnomadchina.com" + "www.digitalnomadchina.com", ], - } + }, }, }; diff --git a/src/app.config.js b/src/app.config.js index fc103aa..dbb741e 100644 --- a/src/app.config.js +++ b/src/app.config.js @@ -7,8 +7,6 @@ export default { 'pages/group/index', 'pages/book/index', 'pages/salon/index', - - ], window: { backgroundTextStyle: 'light',