Skip to content

Commit

Permalink
Do not exclude extensionless files from assets-to-public sync
Browse files Browse the repository at this point in the history
  • Loading branch information
markjaquith committed Jul 13, 2022
1 parent 587477d commit c23be27
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,10 @@ const hooks = [

// copy assets folder to public destination
glob.sync(path.resolve(settings.rootDir, './assets/**/*')).forEach((file) => {
const parsed = path.parse(file);
// Only write the file/folder structure if it has an extension
if (parsed.ext && parsed.ext.length > 0) {
const relativeToAssetsFolder = path.relative(path.join(settings.rootDir, './assets'), file);
const outputPath = path.resolve(settings.distDir, relativeToAssetsFolder);
fs.ensureDirSync(path.parse(outputPath).dir);
fs.outputFileSync(outputPath, fs.readFileSync(file));
}
const relativeToAssetsFolder = path.relative(path.join(settings.rootDir, './assets'), file);
const outputPath = path.resolve(settings.distDir, relativeToAssetsFolder);
fs.ensureDirSync(path.parse(outputPath).dir);
fs.outputFileSync(outputPath, fs.readFileSync(file));
});
},
},
Expand Down

0 comments on commit c23be27

Please sign in to comment.