-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: support Node's --experimental-default-type flag
- Loading branch information
Showing
7 changed files
with
89 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch Program", | ||
"type": "node", | ||
"request": "launch", | ||
"skipFiles": [ | ||
"<node_internals>/**", | ||
"**/node_modules/**" | ||
], | ||
"runtimeArgs": [ | ||
"--import=./lib/index.js", | ||
"--experimental-default-type module" | ||
], | ||
"program": "zz_test.js", | ||
"outFiles": [ | ||
"${workspaceFolder}/lib/*.js" | ||
], | ||
"sourceMaps": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
declare global { | ||
namespace NodeJS { | ||
interface Module { | ||
_compile(code: string, filename: string): string | ||
} | ||
type ModuleType = 'commonjs' | 'module' | ||
|
||
interface NodeError { | ||
code: string | ||
} | ||
// In package.json. | ||
interface PkgType { | ||
type?: ModuleType | ||
} | ||
|
||
type ModuleType = 'commonjs' | 'module' | ||
interface PkgType { | ||
type?: ModuleType | ||
} | ||
} | ||
// The data passed to the initialize() hook. | ||
interface InitializeHookData { | ||
self: string | ||
defaultModuleType: ModuleType | ||
} | ||
|
||
namespace NodeJS { | ||
interface Module { | ||
_compile(code: string, filename: string): string | ||
} | ||
} | ||
} | ||
|
||
declare module 'module' { | ||
export const _extensions: NodeJS.RequireExtensions; | ||
export const _extensions: NodeJS.RequireExtensions | ||
} | ||
|
||
// This file needs to be a module | ||
export {} | ||
export { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters