There are several cases where we need to include some test assets in the static folder so we can do development or run a mock version of an app. However those files are not needed for production, but they are bundled with everything within the static folder.
If we have a local folder inside of static where we put all of our test assets it would be great to have a way to tell webpack or the nuxt framework to ignore that local folder when we execute npm run build.
In .nuxtignore I should be able to include something like
static/local
In order to exclude the local folder from the final build.
I like this feature request, cc @clarkdo
I want this!
Sorry that I must have missed this request, I鈥檒l look into it this week.
I'm looking for this exact feature. I put a json file in /static that I use during development that spoofs the authenticated user for testing and local development, but I don't want it to be included in the build. I would REALLY benefit from this feature, any progress?
@erik06 Sorry that I haven鈥檛 got any time to look into this, I鈥檒l add this to my todos and prepare a pr ASAP.
@jaireina @erik06 .nuxtignore is a config file in src, so it's only loaded in building phase rather than server running. As files under static folder are isolated so they won't be bundled in to bundles files, so if you don't copy the files to production or remove them when you start server, it should work as expected.
@jaireina @erik06
.nuxtignoreis a config file in src, so it's only loaded in building phase rather than server running. As files understaticfolder are isolated so they won't be bundled in to bundles files, so if you don't copy the files to production or remove them when you start server, it should work as expected.
I understand, It鈥檚 the manual removing/ignoring part that I鈥檓 hoping the ignore file will do for me. I鈥檓 aware that I can just remove my file that I don鈥檛 want, but it鈥檚 very manual, prone to forgetfulness and or dependent on another script to remove it when the site is built for production. I鈥檓 looking forward to your PR and very much appreciate your time spent on this!
Most helpful comment
Sorry that I must have missed this request, I鈥檒l look into it this week.