@event-chat/micro-dev-config 0.0.6 → 0.0.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.7](https://github.com/cgfeel/zf-micro-app/compare/micro-dev-config@v0.0.6...micro-dev-config@v0.0.7) (2026-07-09)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add helpers ([3dc8c93](https://github.com/cgfeel/zf-micro-app/commit/3dc8c932012155f6211c8052dc2910aad6a8fbb9))
9
+ * add helpers ([69cd956](https://github.com/cgfeel/zf-micro-app/commit/69cd9566b0308f7cca2c66a008f8f5eb4684ea85))
10
+
3
11
  ## [0.0.6](https://github.com/cgfeel/zf-micro-app/compare/micro-dev-config@v0.0.5...micro-dev-config@v0.0.6) (2026-07-09)
4
12
 
5
13
 
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 返回 loader 的绝对路径
3
+ */
4
+ export declare function loader(name: string): string;
5
+ /**
6
+ * 返回普通模块
7
+ */
8
+ export declare function plugin<T>(name: string): T;
9
+ /**
10
+ * 返回模块的绝对路径
11
+ */
12
+ export declare function resolve(name: string): string;
@@ -0,0 +1,21 @@
1
+ import { createRequire } from 'node:module';
2
+ const requireFromCLI = createRequire(import.meta.url);
3
+ /**
4
+ * 返回 loader 的绝对路径
5
+ */
6
+ export function loader(name) {
7
+ return requireFromCLI.resolve(name);
8
+ }
9
+ /**
10
+ * 返回普通模块
11
+ */
12
+ export function plugin(name) {
13
+ return requireFromCLI(name);
14
+ }
15
+ /**
16
+ * 返回模块的绝对路径
17
+ */
18
+ export function resolve(name) {
19
+ return requireFromCLI.resolve(name);
20
+ }
21
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,cAAc,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAErD;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,IAAY;IAC/B,OAAO,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAI,IAAY;IAClC,OAAO,cAAc,CAAC,IAAI,CAAC,CAAA;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY;IAChC,OAAO,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AACvC,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@event-chat/micro-dev-config",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "统一微前端开发环境",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "micro-cli": "./dist/bin/micro-cli.js"
8
8
  },
9
+ "exports": {
10
+ ".": "./dist/index.js",
11
+ "./helpers": "./dist/helpers.js"
12
+ },
9
13
  "keywords": [
10
14
  "micro app",
11
15
  "dev"
package/src/helpers.ts ADDED
@@ -0,0 +1,24 @@
1
+ import { createRequire } from 'node:module'
2
+
3
+ const requireFromCLI = createRequire(import.meta.url)
4
+
5
+ /**
6
+ * 返回 loader 的绝对路径
7
+ */
8
+ export function loader(name: string) {
9
+ return requireFromCLI.resolve(name)
10
+ }
11
+
12
+ /**
13
+ * 返回普通模块
14
+ */
15
+ export function plugin<T>(name: string): T {
16
+ return requireFromCLI(name)
17
+ }
18
+
19
+ /**
20
+ * 返回模块的绝对路径
21
+ */
22
+ export function resolve(name: string) {
23
+ return requireFromCLI.resolve(name)
24
+ }