Skip to content

Commit 5c01894

Browse files
committed
Support typescript config for older node versions
1 parent 15cea7a commit 5c01894

File tree

4 files changed

+303
-23
lines changed

4 files changed

+303
-23
lines changed

demos/example-electron-node/forge.config.ts renamed to demos/example-electron-node/config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import type ICopyPlugin from 'copy-webpack-plugin';
1616

1717
dotenv.config({path: '.env.local'});
1818

19-
const require = createRequire(import.meta.url);
20-
2119
const ForkTsCheckerWebpackPlugin: typeof IForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
2220
const CopyPlugin: typeof ICopyPlugin = require('copy-webpack-plugin');
2321
const DefinePluginImpl: typeof DefinePlugin = require('webpack').DefinePlugin;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require('tsx/cjs');
2+
3+
module.exports = require('./config.ts');
4+

demos/example-electron-node/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"style-loader": "^3.3.4",
3535
"ts-loader": "^9.5.2",
3636
"ts-node": "^10.9.2",
37+
"tsx": "^4.19.3",
3738
"typescript": "^5.8.2",
3839
"webpack": "^5.90.1"
3940
},

0 commit comments

Comments
 (0)