File tree Expand file tree Collapse file tree 3 files changed +8
-14
lines changed
Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 1- const mod = require ( "../dist/cjs/index.js" ) ;
2- const { TypeScriptLoader } = mod ;
1+ const { TypeScriptLoader } = require ( "../dist/cjs/index.js" ) ;
32TypeScriptLoader ( ) ;
43
54console . info ( "Loaded with CJS successfully" ) ;
Original file line number Diff line number Diff line change 1- import mod from "../dist/cjs/index.js" ;
2- const { TypeScriptLoader } = mod ;
1+ import { TypeScriptLoader } from "../dist/cjs/index.js" ;
32TypeScriptLoader ( ) ;
43
54console . info ( "Loaded with ESM successfully" ) ;
Original file line number Diff line number Diff line change @@ -2,18 +2,14 @@ const assert = require("node:assert");
22
33( async ( ) => {
44 try {
5- const esm = await import ( "../dist/cjs/index.js" ) ;
6- const cjs = require ( "../dist/cjs/index.js" ) ;
5+ const { TypeScriptLoader : esm } = await import ( "../dist/cjs/index.js" ) ;
6+ const { TypeScriptLoader : cjs } = require ( "../dist/cjs/index.js" ) ;
77
8- assert . strictEqual (
9- esm . TypeScriptLoader ,
10- cjs . TypeScriptLoader ,
11- "esm.TypeScriptLoader === cjs.TypeScriptLoader"
12- ) ;
8+ assert . strictEqual ( esm , cjs , "esm === cjs" ) ;
139
14- // try to create loaders
15- esm . TypeScriptLoader ( ) ;
16- cjs . TypeScriptLoader ( ) ;
10+ // Try to create loaders
11+ esm ( ) ;
12+ cjs ( ) ;
1713
1814 console . info ( "Loaded with both CJS and ESM successfully" ) ;
1915 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments