File tree Expand file tree Collapse file tree 7 files changed +27
-4
lines changed
Expand file tree Collapse file tree 7 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 11.idea
22* .iml
3- tmp
3+ tmp
Original file line number Diff line number Diff line change @@ -62,7 +62,8 @@ module.exports = function (grunt) {
6262 options : {
6363 dist_folder : 'tmp/dist' ,
6464 include_time : false ,
65- package_folder : 'test/fixtures/package_custom'
65+ package_folder : 'test/fixtures/package_custom' ,
66+ include_files : [ 'custom.json' ]
6667 }
6768 }
6869 } ,
Original file line number Diff line number Diff line change @@ -191,6 +191,12 @@ grunt.initConfig({
191191
192192#### Options
193193
194+ ##### options.include_files
195+ Type: ` Array `
196+ Default value: ` [] `
197+
198+ List of files to explicitly include in the package, even if they would be ignored by NPM
199+
194200##### options.include_time
195201Type: ` Boolean `
196202Default value: ` true `
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ module.exports = function (grunt) {
2828 var options = this . options ( {
2929 'dist_folder' : 'dist' ,
3030 'include_time' : true ,
31- 'package_folder' : './'
31+ 'package_folder' : './' ,
32+ 'include_files' : [ ]
3233 } ) ;
3334
3435 var pkg = grunt . file . readJSON ( path . resolve ( options . package_folder + '/package.json' ) ) ;
@@ -91,6 +92,17 @@ module.exports = function (grunt) {
9192 }
9293 ] ) ;
9394
95+ if ( options . include_files . length ) {
96+ zipArchive . bulk ( [
97+ {
98+ src : options . include_files ,
99+ dot : true ,
100+ expand : true ,
101+ cwd : options . package_folder
102+ }
103+ ] ) ;
104+ }
105+
94106 zipArchive . finalize ( ) ;
95107
96108 output . on ( 'close' , function ( ) {
Original file line number Diff line number Diff line change 1+ custom.json
Original file line number Diff line number Diff line change 1+ {}
Original file line number Diff line number Diff line change @@ -59,11 +59,12 @@ exports.lambda_package = {
5959 } ) ;
6060 } ,
6161 custom_options : function ( test ) {
62- test . expect ( 5 ) ;
62+ test . expect ( 6 ) ;
6363 var zip = new AdmZip ( "tmp/dist/another-lambda-function_0-0-1_latest.zip" ) ;
6464 var zipEntries = zip . getEntries ( ) ;
6565
6666 var required = [
67+ 'custom.json' ,
6768 'index.js' ,
6869 'package.json' ,
6970 'node_modules/' ,
@@ -79,4 +80,5 @@ exports.lambda_package = {
7980
8081 test . done ( ) ;
8182 }
83+
8284} ;
You can’t perform that action at this time.
0 commit comments