mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Stop using module.createRequire (problematic under webpack), incorporate and export resolveModule helper from markdownlint-cli2.
This commit is contained in:
parent
a1da464618
commit
53ff5c43f1
16 changed files with 327 additions and 25 deletions
16
lib/defer-require.cjs
Normal file
16
lib/defer-require.cjs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// @ts-check
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Calls require for markdownit.cjs. Used to synchronously defer loading because module.createRequire is buggy under webpack (https://github.com/webpack/webpack/issues/16724).
|
||||
*
|
||||
* @returns {any} Exported module content.
|
||||
*/
|
||||
function requireMarkdownItCjs() {
|
||||
return require("./markdownit.cjs");
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
requireMarkdownItCjs
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue