Skip to content

Commit

Permalink
Merge pull request #231 from TAMULib/js_files_not_dirs
Browse files Browse the repository at this point in the history
Ensure JS file is a regular file type and not a directory file type (or any other non-regular file type).
  • Loading branch information
kaladay committed Mar 27, 2023
2 parents ec4d2ff + 6bc8fba commit 191932f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cli/default-webpack.config.js
Expand Up @@ -81,10 +81,12 @@ for (const bundle of Object.keys(entry)) {
}).map((e) => {
const ext = e.split('.').pop();
if (ext === 'js') {
// rename all js files to preserve order through build
// Rename all js files (but not directories) to preserve order through build.
const entry = join(tempPath, `${(++i).toString().padStart(10, '0')}.js`);
fs.copyFileSync(e, entry);
return `!${extractLoader}?modules!${resolve(entry)}`;
if (fs.statSync(e).isFile()) {
fs.copyFileSync(e, entry);
return `!${extractLoader}?modules!${resolve(entry)}`;
}
}
return e;
});
Expand Down

0 comments on commit 191932f

Please sign in to comment.