@zenweb/schedule 4.0.0 → 4.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.
Files changed (2) hide show
  1. package/dist/index.js +4 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import path from 'node:path';
2
+ import { pathToFileURL } from 'node:url';
2
3
  import { globby } from 'globby';
3
4
  import { schedule, ScheduleRegister } from './register.js';
4
5
  export { schedule };
@@ -19,7 +20,9 @@ export default function setup(opt) {
19
20
  d = path.join(process.cwd(), d.slice(2));
20
21
  }
21
22
  for (const file of await globby(option.patterns || '**/*.{ts,js}', { cwd: d, absolute: true })) {
22
- const mod = await import(file);
23
+ setup.debug('load:', file);
24
+ const importUrl = pathToFileURL(file).href;
25
+ const mod = await import(importUrl);
23
26
  for (const i of Object.values(mod)) {
24
27
  if (typeof i === 'function') {
25
28
  scheduleRegister.register(i);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zenweb/schedule",
3
3
  "type": "module",
4
- "version": "4.0.0",
4
+ "version": "4.0.1",
5
5
  "description": "Zenweb Schedule module",
6
6
  "exports": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",