File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,12 @@ module.exports = {
109109
110110 this . webpackConfig = this . configuration . config || this . configuration . webpackConfig ;
111111
112+ if ( this . webpackConfig . includeModules && this . webpackConfig . packagerOptions . noInstall ) {
113+ throw new this . serverless . classes . Error (
114+ '"includeModules" requires an installation, and cannot be used with "packagerOptions.noInstall".'
115+ ) ;
116+ }
117+
112118 // Expose entries - must be done before requiring the webpack configuration
113119 const entries = { } ;
114120
Original file line number Diff line number Diff line change @@ -137,6 +137,15 @@ describe('validate', () => {
137137 return module . validate ( ) . then ( ( ) => expect ( module . webpackConfig . context ) . to . equal ( testServicePath ) ) ;
138138 } ) ;
139139
140+ it ( 'should fail when `includeModules` and `packagerOptions.noInstall` are set' , ( ) => {
141+ const testConfig = {
142+ includeModules : true ,
143+ packagerOptions : { noInstall : true }
144+ } ;
145+ _ . set ( module . serverless . service , 'custom.webpack.config' , testConfig ) ;
146+ expect ( ( ) => module . validate ( ) ) . throws ( ) ;
147+ } ) ;
148+
140149 describe ( 'default target' , ( ) => {
141150 it ( 'should set a default `webpackConfig.target` if not present' , ( ) => {
142151 const testConfig = {
You can’t perform that action at this time.
0 commit comments