Skip to content

Commit

Permalink
Merge pull request #31 from Phala-Network/fix-build-error
Browse files Browse the repository at this point in the history
fix: import path can not end with .ts
  • Loading branch information
Leechael authored Feb 2, 2024
2 parents f5b0b62 + e36c4f5 commit 6f15ea4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib/runWebpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,9 @@ const getBaseConfig = (


function modifyFilePath(filePath: string) {
let newFilePath = filePath.replace(/([^/]+)$/, '_$1')
if (!newFilePath.endsWith('.ts')) {
newFilePath += '.ts'
}
return newFilePath
const parsedPath = path.parse(filePath.replace(/([^/]+)$/, '_$1'))
const newPath = path.join(parsedPath.dir, parsedPath.name)
return newPath
}

export async function runWebpack({
Expand Down

0 comments on commit 6f15ea4

Please sign in to comment.