1.0.24 • Published 4 months ago

utils4u v1.0.24

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

utils4u

utils4u

TypeScript 类型

定义了一些常用的全局类型。

使用方式 1:shims.d.ts

/// <reference types="utils4u/ts-type-helpers" />

使用方式 2:tsconfig.app.json

{
  "compilerOptions": {
    "types": ["utils4u/ts-type-helpers"]
  }
}

createViteProxy

.env.development.local

VITE_PROXY=[["/api-1","http://127.0.0.1:8001"],["/api-2","http://127.0.0.1:8002"]]

vite.config.ts

import { type ConfigEnv, loadEnv, type UserConfig } from "vite";
import { createViteProxy } from "utils4u";

// https://vitejs.dev/config/
export default ({ command, mode }: ConfigEnv): UserConfig => {
  const root = process.cwd();
  const env = loadEnv(mode, root);
  return {
    server: {
      // Load proxy configuration from .env
      proxy: createViteProxy(env.VITE_PROXY),
    },
  };
};
1.0.24

4 months ago

1.0.23

5 months ago

1.0.22

6 months ago

1.0.21

7 months ago

1.0.20

8 months ago

1.0.19

8 months ago

1.0.18

8 months ago

1.0.17

8 months ago

1.0.16

8 months ago

1.0.15

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.9

9 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

11 months ago

1.0.0

12 months ago