File tree Expand file tree Collapse file tree 4 files changed +11
-7
lines changed
typescript-cjs-using-nodejs
typescript-mjs-using-nodejs Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 11{
2- "type" : " module " ,
2+ "type" : " commonjs " ,
33 "engines" : {
44 "node" : " >=18.12.0"
55 }
Original file line number Diff line number Diff line change 33 "target" : " esnext" ,
44 "allowImportingTsExtensions" : true ,
55 "rewriteRelativeImportExtensions" : true ,
6- "module" : " esnext "
6+ "module" : " commonjs "
77 }
88}
Original file line number Diff line number Diff line change 1- import * as path from "node:path" ;
1+ const path = require ( "node:path" ) ;
22
33/* eslint-disable no-useless-concat */
44
@@ -13,4 +13,4 @@ const config = {
1313 } ,
1414} ;
1515
16- export default config ;
16+ module . exports = config ;
Original file line number Diff line number Diff line change 1- const { existsSync } = require ( "node:fs" ) ;
2- const { resolve } = require ( "node:path" ) ;
3- const { run } = require ( "../../../utils/test-utils" ) ;
1+ import { existsSync } from "node:fs" ;
2+ import { dirname , resolve } from "node:path" ;
3+ import { fileURLToPath } from "node:url" ;
4+ import { run } from "../../../utils/test-utils.js" ;
5+
6+ const __filename = fileURLToPath ( import . meta. url ) ;
7+ const __dirname = dirname ( __filename ) ;
48
59describe ( "webpack cli" , ( ) => {
610 it ( "should support typescript esnext file" , async ( ) => {
You can’t perform that action at this time.
0 commit comments