UNPKG

hot-hook

Version:

Easy hot module reloading (HMR) for Node.js and ESM

8 lines (7 loc) 405 B
/* eslint-disable unicorn/custom-error-definition */ import { relative } from 'node:path'; export class FileNotImportedDynamicallyException extends Error { constructor(parentPath, specifier, projectRoot) { super(`The import "${specifier}" is not imported dynamically from ${relative(projectRoot, parentPath)}.\nYou must use dynamic import to make it reloadable (HMR) with hot-hook.`); } }