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.
23 lines
733 B
23 lines
733 B
|
2 years ago
|
/**
|
||
|
|
* @fileoverview Universal module importer
|
||
|
|
*/
|
||
|
|
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
// Imports
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
|
||
|
|
import { createRequire } from "module";
|
||
|
|
import { fileURLToPath } from "url";
|
||
|
|
import { dirname } from "path";
|
||
|
|
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
// Helpers
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
|
||
|
|
const __filename = fileURLToPath(import.meta.url);
|
||
|
|
const __dirname = dirname(__filename);
|
||
|
|
const require = createRequire(__dirname + "/");
|
||
|
|
const { ModuleImporter } = require("./module-importer.cjs");
|
||
|
|
|
||
|
|
export { ModuleImporter };
|