razzle icon indicating copy to clipboard operation
razzle copied to clipboard

Razzle 4 will not copy hidden files from public dir to build dir

Open eltuza opened this issue 3 years ago • 4 comments

🐛 Bug report

Current Behavior

Inside the public directory, we have a hidden folder that needs to be copied into the build/public directory. FTR the hidden folder .well-known is for Google's Digital Asset Links protocol, which needs to serve the following file: www.domain.com/.well-known/assetlinks.json

Using Razzle v3, this hidden folder was being copied to the build/public directory. Upon upgrading to Razzle v4, this folder is omitted.

Expected behavior

Hidden folder inside public should also be copied to build/public during build.

Suggested solution(s)

Razzle 4 makes use of webpack-copy-plugin to copy these files. There is a configuration missing in the patterns globOptions, required to also include hidden files: globOptions: { dot: true }

Your environment

Software Version(s)
Razzle 4.2.17
Razzle Plugins
Node 15.14.0
Browser
Yarn 1.22.5
Operating System MacOS
TypeScript 3.8.3
React

eltuza avatar Jun 09 '22 20:06 eltuza

modify https://github.com/jaredpalmer/razzle/blob/master/packages/razzle/config/createConfigAsync.js#L957

remove and readd plugin in razzle config customization

fivethreeo avatar Jun 09 '22 21:06 fivethreeo

not sure I follow... shall I go ahead and add the dot option to the plugin?

eltuza avatar Jun 10 '22 07:06 eltuza

Yes

fivethreeo avatar Jun 10 '22 18:06 fivethreeo

please review :)

eltuza avatar Jun 13 '22 07:06 eltuza