Skip to content

Commit

Permalink
fix(app-tools): failed to scan public dir when using Rspack (#3497)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Apr 19, 2023
1 parent f08f3ab commit b7b181e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/calm-kangaroos-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/app-tools': patch
---

fix(app-tools): failed to scan public dir when using Rspack

fix(app-tools): 修复 Rspack 模式读取 public 目录失败的问题
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ export const builderPluginAdpaterCopy = (
normalizedConfig.output.distPath?.root || './dist',
'./public',
);

if (!fs.existsSync(publicDir) || !fs.statSync(publicDir).isDirectory()) {
return;
}

const HTML_REGEXP = /\.html?$/;

const filepaths = (await fs.readdir(publicDir)).map(file =>
Expand Down

0 comments on commit b7b181e

Please sign in to comment.