Skip to content

Commit 4bc8586

Browse files
committed
Window issue fix.
1 parent 8a4416c commit 4bc8586

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.vscode-test
22
out
3+
node_modules

src/commands.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as vscode from 'vscode';
2+
23
import * as fs from 'fs-extra';
34
import { run as convertToTypeScript } from 'react-js-to-ts';
45
import { ModuleKind, transpileModule } from 'typescript';
56
import { cjsToEsm } from '@wessberg/cjs-to-esm-transformer';
6-
77
import { editorContext, showInputBox, camelCase, getNewFileName, isJsx } from './utils';
88

99
const { Position } = vscode;
@@ -46,7 +46,9 @@ export async function extractStyle() {
4646
}
4747

4848
export const convertFileToTypescript = async (uri: vscode.Uri) => {
49-
const { path } = uri;
49+
const { fsPath: path } = uri;
50+
51+
console.log(path);
5052

5153
vscode.workspace
5254
.openTextDocument(uri)
@@ -68,7 +70,7 @@ export const convertFileToTypescript = async (uri: vscode.Uri) => {
6870
};
6971

7072
export const convertCjsToEsm = async (uri: vscode.Uri) => {
71-
const { path } = uri;
73+
const { fsPath: path } = uri;
7274

7375
vscode.workspace
7476
.openTextDocument(uri)

0 commit comments

Comments
 (0)