create-packer 1.24.39 → 1.24.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.24.39",
3
+ "version": "1.24.41",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -1,2 +1,2 @@
1
- BASE_URL=/
2
- API_HOST=
1
+ ENV_BASE_URL=/
2
+ ENV_API_HOST=
@@ -1,2 +1,2 @@
1
- BASE_URL=/dev
2
- API_HOST=/api
1
+ ENV_BASE_URL=/dev
2
+ ENV_API_HOST=/api
@@ -1,5 +1,5 @@
1
- declare const BASE_URL: string
2
- declare const API_HOST: string
1
+ declare const ENV_BASE_URL: string
2
+ declare const ENV_API_HOST: string
3
3
 
4
4
  declare module '*.css'
5
5
  declare module '*.less'
@@ -1,8 +1,8 @@
1
1
  import axios from 'axios'
2
2
 
3
- console.log('API_HOST', API_HOST)
3
+ console.log('ENV_API_HOST', ENV_API_HOST)
4
4
  const request = axios.create({
5
- baseURL: BASE_URL + API_HOST
5
+ baseURL: ENV_BASE_URL + ENV_API_HOST
6
6
  })
7
7
 
8
8
  export default request
@@ -16,7 +16,7 @@ export function genRouteUrl(id: routeType['id'], query?: Record<string, any>) {
16
16
  const path = getRoute(id, 'path')
17
17
  if (path) {
18
18
  const { origin } = window.location
19
- let url = origin + BASE_URL + path
19
+ let url = origin + ENV_BASE_URL + path
20
20
  url += query ? `?${stringify(query)}` : ''
21
21
  return url
22
22
  }
@@ -38,5 +38,5 @@ export const routesById = (function flat(routes: routeType[], parentRoute?: rout
38
38
  })(routes)
39
39
 
40
40
  export const router = createBrowserRouter(routes as never, {
41
- basename: BASE_URL
41
+ basename: ENV_BASE_URL
42
42
  })
@@ -29,7 +29,7 @@ function getEnvConfig(mode, isProd) {
29
29
  export default function (env) {
30
30
  const isProd = ['prod', 'analyse'].includes(env.mode)
31
31
  const envConfig = getEnvConfig(env.mode, isProd)
32
- const publicPath = JSON.parse(envConfig.BASE_URL)
32
+ const publicPath = JSON.parse(envConfig.ENV_BASE_URL)
33
33
 
34
34
  return {
35
35
  entry: {