Skip to content

Commit

Permalink
Update module import paths to use file URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Feb 8, 2025
1 parent 96e08d3 commit 479c6dd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion bin/node-pg-migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,9 @@ process.env.SUPPRESS_NO_CONFIG_WARNING = oldSuppressWarning;

const configFileName: string | undefined = argv[configFileArg];
if (configFileName) {
const jsonConfig = await import(resolve(configFileName));
const jsonConfig = await import(`file://${resolve(configFileName)}`, {
with: { type: 'json' },
});
readJson(jsonConfig);
}

Expand Down
2 changes: 1 addition & 1 deletion src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function loadMigrations(
const actions: MigrationBuilderActions =
extname(filePath) === '.sql'
? await migrateSqlFile(filePath)
: await import(filePath);
: await import(`file://${filePath}`);
shorthands = { ...shorthands, ...actions.shorthands };

return new Migration(
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES2023",
"module": "ES2022",
"module": "ESNext",
"moduleResolution": "Node",
"lib": ["ES2023", "DOM"],
"noEmit": true,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.lint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ES2023",
"moduleResolution": "Node",
"module": "ES2022",
"module": "ESNext",
"strict": true,
"noEmit": true,
"lib": ["ES2023"],
Expand Down

0 comments on commit 479c6dd

Please sign in to comment.