0.7.3 • Published 9 months ago

@wakeadmin/transpiler v0.7.3

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

应用模板转换器

目录结构约定

__apps__ # 子应用目录
  foo/   # 子应用放置在自己目录下
  bar/
    mapp.json # 可选,子应用配置
__entry__ # 主应用目录
__i18n__ # 语言包目录
__theme__ # 主题包目录
__config__ # 配置目录
  config.yml # 可选,主配置文件
  config/  # 可选, 子配置文件,会合并到 config.yml, 优先级比 config.yml 高
    myconfig.yml

内置变量

变量名称描述默认值
title?: string应用标题''
version?: string基座版本''
description?: string应用描述, 可以用于 head.meta''
keywords?: string应用关键字,可以用于 head.meta''
base?: string应用的基础路径, 比如 '/portal''/'
domain?: string主域名,比如 www.wakedata.com, 不要包含 http、// 协议前缀,以及路径''
cdnDomain?: stringCDN 域名,比如 cdn.wakedata.com, 不要包含 http、// 协议前缀,以及路径''
npmTheme?: stringnpm 主题包, 指定包名, 比如 demo, demo@0.1.1
npmRegistry?: stringnpm 镜像地址,默认为 npm 官方镜像。如果你的主题包来源于私有环境,需要指定
debug?: boolean调试模式。如果开启,将输出更多日志,以及开启 .map 文件拷贝false
assets?: Record<string, string>资源映射{}

自动变量

变量名称描述
microApps: MicroApp[]已注册的微应用,可以手动配置或者自动发现
theme: { stylesheets: string[],scripts: string[]}主题包内容
i18n: {locale: string}多语言包内容
hash: string唯一 hash,配置文件变动后会生成 hash, 可以用于缓存管理
timestamp: string时间戳(毫秒)
random: number随机值
year: number年份
month: number月份
date: number日期
themePath: string主题路径
i18nPath: string语言包路径
entryPath: string基座路径
appsPath: string子应用路径

内置方法

名称描述
pathJoin(...p: string[])路径连结
normalizePath(p: string)规范化路径,添加 '/' 前缀,并移除 '/' 后缀
removeHeadingSlash(p: string)移除 '/'前缀
removeTrailingSlash(p: string)移除 '/' 后缀
addHeadingSlash(p: string)
addTrailingSlash(p: string)
domainJoin(domain: string, path: string)连结域名和路径
queryString(object)序列化查询字符串
queryJoin(url: string, qs: string | object)连结 url 和查询字符串
0.7.1

9 months ago

0.7.3

9 months ago

0.7.0

10 months ago

0.5.0

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.1

1 year ago

0.4.1

1 year ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.4

2 years ago

0.2.1

2 years ago

0.1.18

2 years ago

0.1.16

2 years ago

0.1.15

2 years ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago