Skip to content

Commit

Permalink
Ensure file is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Nov 12, 2023
1 parent 02b0736 commit 40f90c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/esbuild-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const hanamiEsbuild = (options: PluginOptions = { ...defaults }): Plugin => {
const assets: string[] = [];

files.forEach((file) => {
const srcPath = path.join(dirPath, file);
const srcPath = path.join(dirPath, file.toString());
// Skip if the file is not a file, i.e. a directory
if (!fs.statSync(srcPath).isFile()) {
return;
Expand All @@ -143,7 +143,7 @@ const hanamiEsbuild = (options: PluginOptions = { ...defaults }): Plugin => {
[baseName, fileHash].filter((item) => item !== null).join("-") + fileExtension;
const destPath = path.join(
options.destDir,
path.relative(dirPath, srcPath).replace(file, destFileName),
path.relative(dirPath, srcPath).replace(file.toString(), destFileName),
);

if (fs.lstatSync(srcPath).isDirectory()) {
Expand Down

0 comments on commit 40f90c3

Please sign in to comment.