cloudflare / serverless-cloudflare-workers

Serverless provider plugin for Cloudflare Workers
BSD 3-Clause "New" or "Revised" License
175 stars 37 forks source link

Allow custom webpack config #23

Closed dlackty closed 5 years ago

dlackty commented 5 years ago

The common use case is to mock those nodejs built-in modules required by 3rd party libraries.

jspies commented 5 years ago

Thanks, we've been discussing this and think we'd like to see something like this so that advanced usage would be to provide a standard webpack config file.

functions:
  functionName:
    webpack: ./config/webpack.config.js

This PR would conflict with our ability to add that. Would you be able to handle the mocks in a config file if we finished this feature?

dlackty commented 5 years ago

@jspies I also prefer the way you proposed. My current approach is limited and only suitable for small customization.

Are your team already working on that? I could help to implement.

jspies commented 5 years ago

We have not starting working on it. It would be awesome of you to do.

dlackty commented 5 years ago

@jspies As discussed, I've implemented a way to provide a standard webpack config file. Please have a look and let me know if you have any concerns.

jspies commented 5 years ago

Hey, I really appreciate it. We went ahead and made the change last week. One thing we did was make it "global" to all the functions. This helped bring the deployment time waaaay down when there were quite a few functions.

https://github.com/cloudflare/serverless-cloudflare-workers/pull/26

dlackty commented 5 years ago

That's all right! Just wanna add features that I need and it's good if there's one 👍 Quick question: any plan to add wasm support for this plugin soon?

jspies commented 5 years ago

Fun fact. I'm currently working on wasm right now.