Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4009af3

Browse files
committed
fix: support windows absolute path in extends
1 parentf09e55f commit4009af3

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

‎lib/get-config.js‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import{dirname,extname}from"node:path";
1+
import{dirname}from"node:path";
22
import{fileURLToPath}from"node:url";
33

44
import{castArray,isNil,isPlainObject,isString,pickBy}from"lodash-es";
55
import{readPackageUp}from"read-pkg-up";
66
import{cosmiconfig}from"cosmiconfig";
7-
importresolveFromfrom"resolve-from";
7+
importimportFromfrom"import-from-esm";
88
importdebugConfigfrom"debug";
99
import{repoUrl}from"./git.js";
1010
importPLUGINS_DEFINITIONSfrom"./definitions/plugins.js";
@@ -33,17 +33,7 @@ export default async (context, cliOptions) => {
3333
options={
3434
...(awaitcastArray(extendPaths).reduce(async(eventualResult,extendPath)=>{
3535
constresult=awaiteventualResult;
36-
constresolvedPath=resolveFrom.silent(__dirname,extendPath)||resolveFrom(cwd,extendPath);
37-
constimportAssertions=
38-
extname(resolvedPath)===".json"
39-
?{
40-
assert:{
41-
type:"json",
42-
},
43-
}
44-
:undefined;
45-
46-
const{default:extendsOptions}=awaitimport(resolvedPath,importAssertions);
36+
constextendsOptions=(awaitimportFrom.silent(__dirname,extendPath))||(awaitimportFrom(cwd,extendPath));
4737

4838
// For each plugin defined in a shareable config, save in `pluginsPath` the extendable config path,
4939
// so those plugin will be loaded relative to the config file

‎package-lock.json‎

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"git-log-parser":"^1.2.0",
4444
"hook-std":"^3.0.0",
4545
"hosted-git-info":"^7.0.0",
46+
"import-from-esm":"^1.2.1",
4647
"lodash-es":"^4.17.21",
4748
"marked":"^9.0.0",
4849
"marked-terminal":"^6.0.0",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp