@hile/cli 1.1.15 → 1.1.17

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.
Files changed (2) hide show
  1. package/dist/start.js +4 -2
  2. package/package.json +3 -3
package/dist/start.js CHANGED
@@ -68,7 +68,7 @@ export async function start(options) {
68
68
  }
69
69
  // 开发模式下,使用 tsx 运行
70
70
  if (options.dev) {
71
- await import('tsx/esm');
71
+ // await import('tsx/esm');
72
72
  process.env.NODE_ENV = 'development';
73
73
  }
74
74
  else {
@@ -105,7 +105,9 @@ export async function start(options) {
105
105
  const _file = file.startsWith(AUTO_TAG)
106
106
  ? file.substring(AUTO_TAG.length)
107
107
  : pathToFileURL(file).href;
108
- const target = await import(_file);
108
+ const target = options.dev && _file.endsWith('.ts')
109
+ ? await (await import('tsx/esm/api')).tsImport(_file, import.meta.url)
110
+ : await import(_file);
109
111
  const fn = target?.default ?? target;
110
112
  if (!fn || !isService(fn))
111
113
  throw new Error(`invalid service file: ${file}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hile/cli",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -29,12 +29,12 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@hile/core": "^1.1.2",
32
- "@hile/micro": "^1.0.9",
32
+ "@hile/micro": "^1.0.10",
33
33
  "async-exit-hook": "^2.0.1",
34
34
  "commander": "^14.0.3",
35
35
  "glob": "^13.0.6",
36
36
  "tsx": "^4.21.0",
37
37
  "yaml": "^2.9.0"
38
38
  },
39
- "gitHead": "fa7d6d442ab080e6a395ee2a1dacac9eae340cf6"
39
+ "gitHead": "f18e5f13cba4c2ae2aaa1d6c29990db0b62d0293"
40
40
  }