You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
619 B
20 lines
619 B
// register.js
|
|
// Copyright (C) 2025 DTP Technologies, LLC
|
|
// All Rights Reserved
|
|
|
|
/*
|
|
* Old: node --loader ts-node/esm script.ts
|
|
* New: node --import ./register.js script.ts
|
|
*
|
|
* The new approach is to run this script, which then registers the ESM loader
|
|
* with Node, then immediately uses it. You can do more in this script, but
|
|
* that's bad practice.
|
|
*
|
|
* Don't perform application setup and initialization in this module. Register
|
|
* any loaders you'll need, but that's all.
|
|
*/
|
|
|
|
import { register } from "node:module";
|
|
import { pathToFileURL } from "node:url";
|
|
|
|
register("ts-node/esm", pathToFileURL("./"));
|