Skip to content

Commit 9e8fdb4

Browse files
committed
Rollback moduleResolution to Node
- Rollbacked the `moduleResolution` setting to `Node` in `tsconfig`. - Removed file extension (`.js`) on relative imports.
1 parent bf68d00 commit 9e8fdb4

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

src/main/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import * as path from 'path';
55
// eslint-disable-next-line import/no-extraneous-dependencies
66
import { BrowserWindow, app, ipcMain } from 'electron';
7-
import * as nodeEnv from '_utils/node-env.js';
7+
import * as nodeEnv from '_utils/node-env';
88

99
let mainWindow: Electron.BrowserWindow | undefined;
1010

src/preload/preload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-extraneous-dependencies
22
import { contextBridge } from 'electron';
3-
import ipcAPI from '_preload/ipc-api.js';
3+
import ipcAPI from '_preload/ipc-api';
44

55
contextBridge.exposeInMainWorld('ipcAPI', ipcAPI);

src/renderer/renderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// Import the styles here to process them with webpack
55
import '_public/style.css';
66

7-
import App from '_renderer/App.js';
87
import * as React from 'react';
98
import { createRoot } from 'react-dom/client';
9+
import App from '_renderer/App';
1010

1111
const container = document.getElementById('app');
1212
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion

src/types/global.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
declare global {
22
interface Window {
33
/** APIs for Electron IPC */
4-
ipcAPI?: typeof import('_preload/ipc-api.js').default
4+
ipcAPI?: typeof import('_preload/ipc-api').default
55
}
66
}
77

tests/main/main.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { jest } from '@jest/globals';
22
import { BrowserWindow } from 'electron';
3-
import { exportedForTests } from '_main/main.js';
3+
import { exportedForTests } from '_main/main';
44

55
jest.mock('electron', () => ({
66
app: {

tests/utils/node-env.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test('NODE_ENV=test', async () => {
44
process.env.NODE_ENV = 'test';
55
jest.resetModules();
66

7-
const nodeEnv = await import('_utils/node-env.js');
7+
const nodeEnv = await import('_utils/node-env');
88

99
expect(nodeEnv.test).toBeTruthy();
1010
expect(nodeEnv.dev).toBeFalsy();
@@ -15,7 +15,7 @@ test('NODE_ENV=development', async () => {
1515
process.env.NODE_ENV = 'development';
1616
jest.resetModules();
1717

18-
const nodeEnv = await import('_utils/node-env.js');
18+
const nodeEnv = await import('_utils/node-env');
1919

2020
expect(nodeEnv.dev).toBeTruthy();
2121
expect(nodeEnv.prod).toBeFalsy();
@@ -26,7 +26,7 @@ test('NODE_ENV=production', async () => {
2626
process.env.NODE_ENV = 'production';
2727
jest.resetModules();
2828

29-
const nodeEnv = await import('_utils/node-env.js');
29+
const nodeEnv = await import('_utils/node-env');
3030

3131
expect(nodeEnv.prod).toBeTruthy();
3232
expect(nodeEnv.dev).toBeFalsy();

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"strict": true,
44
"baseUrl": ".",
55
"module": "ES2020",
6-
"moduleResolution": "Node16",
6+
"moduleResolution": "Node",
77
"paths": {
88
"_/*": ["src/*"],
99
"_public/*": ["public/*"],

0 commit comments

Comments
 (0)