Skip to content

Add specific import to all generated lambda-functions #401

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
matuscongrady opened this issue May 28, 2018 · 3 comments
Closed

Add specific import to all generated lambda-functions #401

matuscongrady opened this issue May 28, 2018 · 3 comments

Comments

@matuscongrady
Copy link

This is a Feature Proposal

Description

Hello,
This might be more webpack related than serverless-webpack related. If so, feel free to close this.

Is it possible to include a specific import to all generated lambda-functions?
I have to include 'source-map-support/register' into all functions in order to get source maps working.

This (in my oppinion) creates a lot of unnecessary imports and can lead to problems if I forget to import it in a particular file.

Or is there any other better solution to make sourcemaps work?

Thanks!

@HyperBrain
Copy link
Member

HyperBrain commented May 28, 2018

Hi @mcongy , you can use the source-map-support webpack plugin and just configure it for the babel loader.

      "plugins": [
        "source-map-support"
      ]

Just make sure that you have the source-map-support module in your dependencies and the babel-plugin-source-map-support in your devDependencies. It will automatically add it.

@HyperBrain
Copy link
Member

Additionally #397 is in progress right now and will allow adding arbitrary modules to the webpack entries. This will be a second approach for anyting else than source-map-support.

@HyperBrain
Copy link
Member

Closing this. The progress of the feature is tracked by #397

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants