Skip to content

Commit c4471d9

Browse files
committed
refactor: make path import node 14 compatible
1 parent 10b26a5 commit c4471d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/onCreateNode/translateNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FileSystemNode } from 'gatsby-source-filesystem';
22
import convertToSlug from 'limax';
33
import fs from 'fs/promises';
4-
import path from 'path/posix';
4+
import { posix as path } from 'path';
55
import { OnCreateNode, PluginOptions } from '../../types';
66
import { addLocalePrefix, trimRightSlash } from '../utils/path';
77
import { findClosestLocale, parseFilename } from '../utils/i18n';

src/utils/path.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import nodePath from 'path/posix';
1+
import { posix as nodePath } from 'path';
22
import { PluginOptions } from '../../types';
33

44
export const trimRightSlash = (path: string) => {

0 commit comments

Comments
 (0)