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

Shareable Configs #2748

Closed
jhanikhilnath opened this issue Jun 1, 2021 · 14 comments · Fixed by #3738
Closed

Shareable Configs #2748

jhanikhilnath opened this issue Jun 1, 2021 · 14 comments · Fixed by #3738

Comments

@jhanikhilnath
Copy link

Feature request

What is the expected behavior?
Having shareable configs

What is motivation or use case for adding/changing the behavior?
We have to write webpack configs every time we start a new big project. Which is usually twice or thrice a year. So, having shareable configs would be very useful.

How should this be implemented in your opinion?
Just like in eslint

module.exports = {
  extends: ["shareable config name"]
}

Are you willing to work on this yourself?
No. I don't have the skills for it. I am a learning developer

P.S: My english is not very good as it is not my first language

@alexander-akait
Copy link
Member

Please use this package to achieve this https://github.com/survivejs/webpack-merge. Also you can publish package (common configuration) and require/import it in your new package. Webpack configuration can be complex and there is no single strategy on how best to do it - some options better to merge, other to override.

@alexander-akait alexander-akait transferred this issue from webpack/webpack Jun 2, 2021
@alexander-akait
Copy link
Member

@webpack/cli-team what do you think?

@snitin315
Copy link
Member

I think the same behavior can be achieved through --merge. But if we want it to be an option in config we will need to update webpack schema.

@alexander-akait
Copy link
Member

Yep, right direction, In theory we can require/import from extends and apply webpack-merge, we don't need update schema, because we remove extends from webpack.config.js internally, we need update only types, but it is not hard

@snitin315
Copy link
Member

Sounds good 👍🏻 , I will send a PR.

@alexander-akait
Copy link
Member

@snitin315 Don't forget extended configuration can have extends too, so we need do it in loop until we have extends

@snitin315
Copy link
Member

Thanks for the point. I will keep that in mind 👍🏻

@jhanikhilnath
Copy link
Author

I am very confused as to what is happening as this is my first issue in github
Can someone summarise everything

@snitin315
Copy link
Member

Can someone summarise everything

We will implement this feature request in the near future 😄

@jhanikhilnath
Copy link
Author

jhanikhilnath commented Jun 3, 2021 via email

@arzyu
Copy link

arzyu commented Jul 9, 2021

@jhanikhilnath I created a tool that can meet your needs. arzyu/airpack

@webpack-bot
Copy link

This issue had no activity for at least half a year.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@alexander-akait
Copy link
Member

bump

@webpack-bot
Copy link

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

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