@longzai-intelligence-taro/config 0.0.1
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/README.md +28 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @longzai-intelligence-taro/config
|
|
2
|
+
|
|
3
|
+
Taro 构建配置封装包。对 `@tarojs/cli` 的 `defineConfig` 与类型(`UserConfigExport`、`UserConfigFn`、`ConfigEnv`)做一层 re-export,作为各项目 `apps/miniprogram/config/` 的统一配置入口。
|
|
4
|
+
|
|
5
|
+
## 用法
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
// apps/miniprogram/config/index.ts
|
|
9
|
+
import { defineConfig, type UserConfigExport } from '@longzai-intelligence-taro/config';
|
|
10
|
+
|
|
11
|
+
export default defineConfig<'taro'>(async (merge) => {
|
|
12
|
+
const base: UserConfigExport<'taro'> = { /* ... */ };
|
|
13
|
+
return merge({}, base, process.env.NODE_ENV === 'development' ? devConfig : prodConfig);
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// apps/miniprogram/config/dev.ts
|
|
19
|
+
import { defineConfig } from '@longzai-intelligence-taro/config';
|
|
20
|
+
|
|
21
|
+
export default defineConfig(async (merge) => {
|
|
22
|
+
return merge({}, { mini: {}, h5: {} });
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## peerDependency
|
|
27
|
+
|
|
28
|
+
依赖 `@tarojs/cli@^4.0.0`,由消费方项目(miniprogram)安装。
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Taro 构建配置封装
|
|
3
|
+
*
|
|
4
|
+
* @description 对 `@tarojs/cli` 的 `defineConfig` / `UserConfigExport` 做一层 re-export,
|
|
5
|
+
* 放宽泛型约束(允许消费方传入 `'taro'` 等自定义编译器标识),统一 miniprogram 的配置入口。
|
|
6
|
+
*/
|
|
7
|
+
export { defineConfig, type ConfigEnv, type UserConfigExport, type UserConfigFn, } from '@tarojs/cli';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,aAAa,CAAC","sourcesContent":["/**\n * Taro 构建配置封装\n *\n * @description 对 `@tarojs/cli` 的 `defineConfig` / `UserConfigExport` 做一层 re-export,\n * 放宽泛型约束(允许消费方传入 `'taro'` 等自定义编译器标识),统一 miniprogram 的配置入口。\n */\n\nexport {\n defineConfig,\n type ConfigEnv,\n type UserConfigExport,\n type UserConfigFn,\n} from '@tarojs/cli';\n"]}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,YAAY,GAIb,MAAM,aAAa,CAAC","sourcesContent":["/**\n * Taro 构建配置封装\n *\n * @description 对 `@tarojs/cli` 的 `defineConfig` / `UserConfigExport` 做一层 re-export,\n * 放宽泛型约束(允许消费方传入 `'taro'` 等自定义编译器标识),统一 miniprogram 的配置入口。\n */\n\nexport {\n defineConfig,\n type ConfigEnv,\n type UserConfigExport,\n type UserConfigFn,\n} from '@tarojs/cli';\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@longzai-intelligence-taro/config",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Taro 构建配置封装 - re-export @tarojs/cli 的 defineConfig 与类型",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"config",
|
|
7
|
+
"longzai-intelligence",
|
|
8
|
+
"taro",
|
|
9
|
+
"taroutils"
|
|
10
|
+
],
|
|
11
|
+
"license": "UNLICENSED",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsgo --build tsconfig/build.json --force",
|
|
27
|
+
"build:prod": "bun run build",
|
|
28
|
+
"typecheck": "tsgo --noEmit -p tsconfig/app.json",
|
|
29
|
+
"prepublishOnly": "bun run build:prod",
|
|
30
|
+
"clean": "lzi-dev-cli clean"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@tarojs/cli": "^4.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@tarojs/cli": "^4.0.0"
|
|
37
|
+
}
|
|
38
|
+
}
|