Skip to content

Commit

Permalink
fix macos dev
Browse files Browse the repository at this point in the history
  • Loading branch information
franzzua committed Dec 6, 2023
1 parent 825673c commit 09556f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tools/compile/ts-resolve-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Visitor {
}
}
findFile(importPath, sourceFile) {
const sourceFileDir = path.dirname(sourceFile.path);
const sourceFileDir = path.dirname(sourceFile.fileName);

return [
importPath,
Expand All @@ -56,7 +56,7 @@ class Visitor {
].find(x => fs.existsSync(path.resolve(sourceFileDir, x)))?.replace(/(\.ts)x?$/, '.js');
}
resolveFile(importPath, sourceFile){
const sourceFileDir = path.dirname(sourceFile.path);
const sourceFileDir = path.dirname(sourceFile.fileName);
const existed = this.findFile(importPath, sourceFile);
if (existed) return existed;
const suggestions = this.resolver.getImportSuggestions(importPath, sourceFileDir) ?? [];
Expand All @@ -72,7 +72,7 @@ class Visitor {
*/
resolve(importPath, sourceFile){
importPath = this.resolveFile(importPath, sourceFile);
const sourceFileDir = path.dirname(sourceFile.path);
const sourceFileDir = path.dirname(sourceFile.fileName);
const caseSensitiveFileNames = this.context.getEmitHost().useCaseSensitiveFileNames();
const formatPath = caseSensitiveFileNames ? x => x : x => x.toLowerCase();
const absSource = path.join(this.options.outDir, path.relative(this.options.baseUrl, sourceFileDir));
Expand Down
2 changes: 1 addition & 1 deletion tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cmmn/tools",
"version": "2.0.0",
"version": "2.0.1",
"description": "Compilation, bundling, code generator, testing.",
"main": "dist/rollup.config.js",
"type": "module",
Expand Down

0 comments on commit 09556f8

Please sign in to comment.