fix: support windows absolute extends (#3062)
This commit is contained in:
+3
-13
@@ -1,10 +1,10 @@
|
||||
import { dirname, extname } from "node:path";
|
||||
import { dirname } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import { castArray, isNil, isPlainObject, isString, pickBy } from "lodash-es";
|
||||
import { readPackageUp } from "read-pkg-up";
|
||||
import { cosmiconfig } from "cosmiconfig";
|
||||
import resolveFrom from "resolve-from";
|
||||
import importFrom from "import-from-esm";
|
||||
import debugConfig from "debug";
|
||||
import { repoUrl } from "./git.js";
|
||||
import PLUGINS_DEFINITIONS from "./definitions/plugins.js";
|
||||
@@ -33,17 +33,7 @@ export default async (context, cliOptions) => {
|
||||
options = {
|
||||
...(await castArray(extendPaths).reduce(async (eventualResult, extendPath) => {
|
||||
const result = await eventualResult;
|
||||
const resolvedPath = resolveFrom.silent(__dirname, extendPath) || resolveFrom(cwd, extendPath);
|
||||
const importAssertions =
|
||||
extname(resolvedPath) === ".json"
|
||||
? {
|
||||
assert: {
|
||||
type: "json",
|
||||
},
|
||||
}
|
||||
: undefined;
|
||||
|
||||
const { default: extendsOptions } = await import(resolvedPath, importAssertions);
|
||||
const extendsOptions = (await importFrom.silent(__dirname, extendPath)) || (await importFrom(cwd, extendPath));
|
||||
|
||||
// For each plugin defined in a shareable config, save in `pluginsPath` the extendable config path,
|
||||
// so those plugin will be loaded relative to the config file
|
||||
|
||||
Reference in New Issue
Block a user