Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support for multi-compiler [Webpack 2] #124

Closed
logicalicy opened this issue May 18, 2017 · 5 comments
Closed

Support for multi-compiler [Webpack 2] #124

logicalicy opened this issue May 18, 2017 · 5 comments
Labels

Comments

@logicalicy
Copy link

logicalicy commented May 18, 2017

Perhaps one for the future –

To create separate output filename patterns, using separate configs with Webpack's multi-compiler comes in handy.

When attempting to use this Webpack feature, we see:

TypeError: Cannot read property 'errors' of undefined
    at BbPromise.fromCallback.then.stats (<PATH_TO_PROJECT>/node_modules/serverless-webpack/lib/compile.js:24:30)

While only single configs are supported currently, I thought to add here to track possible future support for multiple configs.

@HyperBrain
Copy link
Member

This is related to #120 . If we'd support optimal individual packaging with separate tree-shaking and optimization per lambda function, multi-compiler support is a must.

So this will be handled as an implementation step there, with the first approach being automatic configuration as soon as you enable individual packaging.

@HyperBrain
Copy link
Member

I've prepared the plugin's infrastructure to support manual multi-compile scenarios with a subsequent implementation in #177 . As soon as we're on v3, we can take care of this.

@HyperBrain HyperBrain added this to the 3.1.0 milestone Aug 10, 2017
@HyperBrain HyperBrain modified the milestones: 3.1.0, 3.2.0 Sep 18, 2017
@HyperBrain HyperBrain removed this from the 3.2.0 milestone Oct 10, 2017
@HyperBrain
Copy link
Member

@logicalicy Is this still an issue? With all the improvements done in V3, especially the slsw.lib objects you now have full access to the serverless environment and can create a single webpack config that configures itself by evaluating that state.
Additionally, for individual packaging multi-compile is now automatically enabled, to let Webpack optimize every single function separately.

@HyperBrain
Copy link
Member

I'll close this now as there were no responses for a long time. Feel free to revive the discussion if needed.

@taschmidt
Copy link

Hey there, I just ran across this issue. I have a serverless project with multiple server-side bundles (lambdas) but now I need to put together a client-side bundle. Without support for multiple configs (i.e. one "node" and one "web"), how am I supposed to do this?

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

No branches or pull requests

3 participants