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 = {
109
109
110
110
this . webpackConfig = this . configuration . config || this . configuration . webpackConfig ;
111
111
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
+
112
118
// Expose entries - must be done before requiring the webpack configuration
113
119
const entries = { } ;
114
120
Original file line number Diff line number Diff line change @@ -137,6 +137,15 @@ describe('validate', () => {
137
137
return module . validate ( ) . then ( ( ) => expect ( module . webpackConfig . context ) . to . equal ( testServicePath ) ) ;
138
138
} ) ;
139
139
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
+
140
149
describe ( 'default target' , ( ) => {
141
150
it ( 'should set a default `webpackConfig.target` if not present' , ( ) => {
142
151
const testConfig = {
You can’t perform that action at this time.
0 commit comments