mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-18 12:05:32 +00:00
14 lines
377 B
JavaScript
14 lines
377 B
JavaScript
import { isAbsolute } from 'node:path';
|
|
import { pathToFileURL } from 'node:url';
|
|
|
|
/**
|
|
* Dynamic import wrapper for compatibility with absolute paths on Windows
|
|
*
|
|
* @see https://github.com/stylelint/stylelint/issues/7382
|
|
*
|
|
* @param {string} path
|
|
*/
|
|
export default function dynamicImport(path) {
|
|
return import(isAbsolute(path) ? pathToFileURL(path).toString() : path);
|
|
}
|