mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Work around lack of webpack support for dynamic calls to require (.resolve).
This commit is contained in:
parent
7e2acfc593
commit
a79e7843f2
2 changed files with 14 additions and 2 deletions
|
@ -783,6 +783,10 @@ var markdownIt = __webpack_require__(/*! markdown-it */ "markdown-it");
|
|||
var rules = __webpack_require__(/*! ./rules */ "../lib/rules.js");
|
||||
var helpers = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
|
||||
var cache = __webpack_require__(/*! ./cache */ "../lib/cache.js");
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line camelcase, max-len, no-inline-comments, no-undef
|
||||
var dynamicRequire = (typeof require === "undefined") ? __webpack_require__("../lib sync recursive") : /* c8 ignore next */ require;
|
||||
// Capture native require implementation for dynamic loading of modules
|
||||
var deprecatedRuleNames = ["MD002", "MD006"];
|
||||
/**
|
||||
* Validate the list of rules for structure and reuse.
|
||||
|
@ -1616,7 +1620,7 @@ function resolveConfigExtends(configFile, referenceId) {
|
|||
// If not a file or fs.statSync throws, try require.resolve
|
||||
}
|
||||
try {
|
||||
return __webpack_require__("../lib sync recursive").resolve(referenceId, { "paths": [configFileDirname] });
|
||||
return dynamicRequire.resolve(referenceId, { "paths": [configFileDirname] });
|
||||
}
|
||||
catch (_b) {
|
||||
// If require.resolve throws, return resolvedExtendsFile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue