Skip to content

Commit

Permalink
Merge pull request #7 from timlrx/fix/windows-path
Browse files Browse the repository at this point in the history
fix absolute path import for Windows
  • Loading branch information
timlrx authored Apr 23, 2024
2 parents 6c00d13 + 0d0dcfa commit 172f039
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
"rxjs": "^7.1.0"
},
"packageManager": "[email protected]"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { GetContentlayerVersionError } from '@contentlayer2/utils/node'
import { getContentlayerVersion } from '@contentlayer2/utils/node'
import { camelCase } from 'camel-case'
import type { PackageJson } from 'type-fest'
import * as URL from 'url'

import { ArtifactsDir } from '../ArtifactsDir.js'
import type { HasCwd } from '../cwd.js'
Expand Down Expand Up @@ -131,7 +132,7 @@ const successCallback = (onSuccess: SuccessCallback | undefined) => {
T.tapSync((path) => console.log('successCallback', path)),
T.chain((generatedPkgPath) =>
T.tryCatchPromise(
() => onSuccess(() => import(filePathJoin(generatedPkgPath, 'generated', 'index.mjs'))),
() => onSuccess(() => import(URL.pathToFileURL(filePathJoin(generatedPkgPath, 'generated', 'index.mjs')).href)),
(error) => new SuccessCallbackError({ error }),
),
),
Expand Down

0 comments on commit 172f039

Please sign in to comment.