mirror of
https://gh.wpcy.net/https://github.com/djav1985/v-wordpress-plugin-updater.git
synced 2026-04-30 11:35:48 +08:00
13 lines
377 B
JavaScript
13 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);
|
|
}
|