Gatsby: Make configurable what kinds of static assets will be copied

Created on 1 Jun 2016  路  5Comments  路  Source: gatsbyjs/gatsby

It seems like static assets are set in this line:

https://github.com/gatsbyjs/gatsby/blob/9b14d0024e3a6136b56b1c61310312b73805e672/lib/utils/post-build.js#L58

In my current project I got a lot of large original images (jpg). I use them only via loader. So it would be nice if could prevent them from being copied to the public folder, so that uploading / deploying gets faster and no webspace is wasted.

On the other hand I would like the .htaccess to be copied. I required it for now but adding it to the assets would be more elegant I guess.

(I hope I did not miss something and this is already possible ;-) )

Most helpful comment

All 5 comments

This is not currently possible and is a known sore spot. I have a pretty good idea for how to fix this and it's my next task on my TODO list for Gatsby. Hopefully the next release will have a good pattern for controlling which file types are considered "assets".

Ok thanks, looking forward to the next release then :-)

Just curious about this. Having .htaccess copied over would be great to create a drafts directory, which would be generated like the rest of the site, but could be password protected for example. Another use would be to password protect specific subdirs for collaborators or clients.
Thanks for the great work.

Congrats on the upcoming 1.0; been keeping an eye on this project, I was wondering if this issue/feature will be in 1.0. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

signalwerk picture signalwerk  路  3Comments

KyleAMathews picture KyleAMathews  路  3Comments

mikestopcontinues picture mikestopcontinues  路  3Comments

theduke picture theduke  路  3Comments

rossPatton picture rossPatton  路  3Comments