nfour / serverless-build-plugin

A Node.js focused build plugin for serverless.
MIT License
41 stars 9 forks source link

Ensure the `sourceMaps` configuration option is respected if switched off #18

Closed brendo closed 7 years ago

brendo commented 7 years ago

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.

nfour commented 7 years ago

Thanks!