This small fix ensures that if the serverless build configuration sets sourceMaps: false, that this setting is passed down to Babel so that source maps are not added to the artifacts.
This also fixes a small bug where the Babel transformer could be a passed a boolean value, which leave the default of sourceMaps: 'both'.
If sourceMaps is set to false in the build config, this will override anything set by either a .babelrc file, or if babel is actually an object in the configuration and not a boolean.
This small fix ensures that if the serverless build configuration sets
sourceMaps: false
, that this setting is passed down to Babel so that source maps are not added to the artifacts.This also fixes a small bug where the Babel transformer could be a passed a boolean value, which leave the default of
sourceMaps: 'both'
.If
sourceMaps
is set to false in the build config, this will override anything set by either a.babelrc
file, or ifbabel
is actually an object in the configuration and not a boolean.