webpack-cli icon indicating copy to clipboard operation
webpack-cli copied to clipboard

Shareable Configs

Open jhanikhilnath opened this issue 4 years ago β€’ 14 comments

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

jhanikhilnath avatar Jun 01 '21 09:06 jhanikhilnath

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 avatar Jun 01 '21 11:06 alexander-akait

@webpack/cli-team what do you think?

alexander-akait avatar Jun 02 '21 11:06 alexander-akait

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.

snitin315 avatar Jun 02 '21 12:06 snitin315

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

alexander-akait avatar Jun 02 '21 12:06 alexander-akait

Sounds good πŸ‘πŸ» , I will send a PR.

snitin315 avatar Jun 02 '21 12:06 snitin315

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

alexander-akait avatar Jun 02 '21 12:06 alexander-akait

Thanks for the point. I will keep that in mind πŸ‘πŸ»

snitin315 avatar Jun 02 '21 12:06 snitin315

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

jhanikhilnath avatar Jun 02 '21 15:06 jhanikhilnath

Can someone summarise everything

We will implement this feature request in the near future πŸ˜„

snitin315 avatar Jun 03 '21 04:06 snitin315

Seriously I can’t believe that my first feature request on github is being implemented

jhanikhilnath avatar Jun 03 '21 10:06 jhanikhilnath

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

arzyu avatar Jul 09 '21 04:07 arzyu

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.

webpack-bot avatar Feb 01 '22 05:02 webpack-bot

bump

alexander-akait avatar Feb 01 '22 11:02 alexander-akait

Issue was closed because of inactivity.

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

webpack-bot avatar Aug 18 '22 14:08 webpack-bot