I would like to know If there is any possibility to tell sam build command to copy files that are excluded via .gitignore
Can you expand a bit more on what runtime you're using and what you're trying to do?
Good morning @awood45 !
I'm using aws-sdk for nodeJS. I think It could be a great idea to tell sam build command to copy specific files to dist folder. Thanks in advance
I'm also having this issue, i need to exclude credentials but i need that sam build include those files. For example a json file with the database connection settings, i don't want to include this file on my git project but i want to sam build to include it.
Runtime: nodejs12.x
Is there a way to configure sam build to include those files that are in .gitignore?
I had this issue before,this is NPM pack related not SAM related, by NPM look for a file called .npmignore to exclude files from build, else it used .gitignore to exclude files from build, we always mention dist folder in .gitignore, that why sam build doesn't include dist folder, there are two ways to solve this issue.
.npmignore, but it does has disadvantage that now npm will copy your senstive files into buildfiles array in package.json to tell which file to include.For Reference:
Closing as this is NPM related.
Most helpful comment
Good morning @awood45 !
I'm using aws-sdk for nodeJS. I think It could be a great idea to tell sam build command to copy specific files to dist folder. Thanks in advance