@nightgale/uni-patch
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

uni-patch

UniApp 内置组件编译补丁扩展。

安装

pnpm add -D @@nightgale/uni-patch

使用

vite.config

// vite.config.ts
import { defineConfig } from 'vite'
import Uni from '@dcloudio/vite-plugin-uni'
import UniPatch from '@nightgale/uni-patch'

// It is recommended to put it in front of Uni
export default defineConfig({
  plugins: [
    UniPatch(),
    Uni()
  ],
})

选项配置

interface Options {
 /**
  * 手动分包处理,该选项会覆盖 UniApp 中的分包策略
  * @apply build
  */
 manualChunks?: { [chunkAlias: string]: string[] } | (id: string, meta: ManualChunkMeta) => string | NullValue;

 /**
  * 该选项用于指定 chunks 的入口文件模式
  * @apply build
  */
 entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);

 /**
  * 该选项用于对代码分割中产生的 chunk 自定义命名
  * @apply build
  */
 chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);

 /**
  * 用于自定义构建结果中的静态资源名称
  * @apply build
  */
 assetFileNames?:  string | ((chunkInfo: PreRenderedAsset) => string);

 /**
  * 覆盖 UniApp 内置模块样式配置
  * @description 支持纯 css 样式文件 与 scss 编译样式文件
  * @example
  * {
  *   '@dcloudio/uni-h5/style/framework/base.css': '@/styles/framework/base.css'
  * }
  */
 buildInCssReplace: Record<string, string>;

 /**
  * 是否输出日志
  * @default false
  */
 debug: boolean;
}

Readme

Keywords

Package Sidebar

Install

npm i @nightgale/uni-patch

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

23.3 kB

Total Files

7

Last publish

Collaborators

  • nightgale