Skip to content

Commit

Permalink
fix: windows 环境 路径覆盖错误
Browse files Browse the repository at this point in the history
  • Loading branch information
liaoyinglong authored and jaywcjlove committed Jan 11, 2021
1 parent 30d0448 commit eaae043
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/overrides/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export const overridePaths = (argvs = undefined as ParsedArgs | undefined, opts:
const oldAppSrc = pathsConf.appSrc;
pathsConf.appSrc = path.resolve(pathsConf.appPath, argvs['app-src']);
Object.keys(pathsConf).forEach((keyname) => {
if ((new RegExp(`^${oldAppSrc}`)).test(pathsConf[keyname])) {
pathsConf[keyname] = pathsConf[keyname].replace(new RegExp(`^${oldAppSrc}`), pathsConf.appSrc);
if (typeof pathsConf[keyname] === 'string' && pathsConf[keyname].startsWith(oldAppSrc)) {
pathsConf[keyname] = pathsConf[keyname].replace(oldAppSrc, pathsConf.appSrc)
}
});
}
// override config in memory
require.cache[require.resolve(pathsConfPath)].exports = pathsConf;
return { ...pathsConf, _oldPaths };
}
}

2 comments on commit eaae043

@vercel
Copy link

@vercel vercel bot commented on eaae043 Jan 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

@vercel
Copy link

@vercel vercel bot commented on eaae043 Jan 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kkt – ./

kkt.398188662.vercel.app
kkt.vercel.app
kkt-git-master.398188662.vercel.app

Please sign in to comment.