-
Notifications
You must be signed in to change notification settings - Fork 416
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
fix: implemented the multiple webpack compile config #537
fix: implemented the multiple webpack compile config #537
Conversation
I will give it a try to resolve the two constraints mentioned above with my solution. Mean time you can provide the feedback for existing changes. Thanks! |
4c01c07
to
63fe24d
Compare
@HyperBrain , Can you please review? |
@HyperBrain , any comment/update on this? |
@HyperBrain, any luck? |
@HyperBrain , Sorry to ping you one more time. Did you get a chance to look into this one? |
* Add copyExistingArtifacts to packageModules * Refactor packageModules * Set service path * Generate artifact name from service * Output artifacts to .webpack before copying * Set artifact name for service packaging * Skip webpack:compile if --no-build is set * Add webpack:package:copyExistingArtifacts hook * Make packageModules & packExternalModules no-op if skipCompile is set * Refactor packageModules * Remove artifact location setting from packageModules * Update cleanup to check this.keepOutputDirectory * Fix path join on Windows Co-authored-by: Miguel A. Calles MBA <44813512+miguel-a-calles-mba@users.noreply.github.com>
👍 for this fix. I could use it as well. I've got a webpack.config that builds several different entries, with different outputs and plugins, and serverless with serverless-webpack chokes on
Edit: Workaround, totally silly, but works.If you have a
Then in your
This will allow you to group various entries with unique outputs and plugins in a single config, and run them (or some subset) prior to running the serverless webpack entry. |
@tyrauber , if you have your code somewhere on github, then I will take a look. If not passible to share the code, then share the snippet. |
Hi @RishikeshDarandale, here is a gist of a Serverless Vue Webpack 4 Config that details the issue. The problem comes from wanting to code split and share a base configuration and use webpack-merge to maintain them. Each entry - client, server, serverless - potentially needs different plugins or outputs. Unfortunately, serverless-webpack chokes on an array of exports, while webpack handles it fine. |
- multi compile config option implemented with checking the config object is an array or not. - when package.individually is false, then all config should have same exact output.path of each compile config. - when package.individually is true, compile config should be equal to or greater than function count and output.path of each config of a function should ends with functon name With above imlementation, the rest did not need to change and work as it is.
d6a6cb5
to
a500a84
Compare
@miguel-a-calles-mba Can you please review this wrt |
@miguel-a-calles-mba , any update on this pull request? |
@RishikeshDarandale This PR is set for 5.4.0. |
sure @miguel-a-calles-mba I have rebased my changes with release |
@RishikeshDarandale, I resolved the conflicts. Please verify the changes. |
Sorry I made a mistake while merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the merge conflicts and the failed builds. Thanks.
@RishikeshDarandale any chances to rebase against the master, fix conflicts and tests? Thanks 🙏 |
@j0k3r , let me find some time to check this one. It's a year old change now. |
Will you have time to update it? |
What did you implement:
Implemented the fix for providing a way to provide the multiple webpack compile configuration in webpack configuration file. The sample config can be seen as below:
Similarly, webpack configuration can export an
asynchronous object
with multi compile configuration would work as expected.Closes #439
How did you implement it:
This plugin already supports the multi compile configuration when
package.individually
is set totrue
. When there are multiple functions andpackage.individually
is set, then provided single webpack configuration gets cloned for function count times.Thus, providing multi compile configuration in webpack should be possible with some constraint/assumption.
validate
function was expecting a single webapck configuration object.When multi webpack compile config is provided, to constraints will be imposed as below:
package.individually
isfalse
, thenoutput.path
for each config provided should match.package.individually
istrue
, then compile config should be provided for each function and theoutput.path
of compile should end withfunction-name
.Above constraints make sure that post
validate
process such ascompile
,package
,local invoke
andoffline
functions behave as it is.How can we verify it:
I have verified this with following examples:
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO