Skip to content

Introduce a way for extending Webpack configurations #265

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

Closed
halfzebra opened this issue Jul 3, 2018 · 7 comments
Closed

Introduce a way for extending Webpack configurations #265

halfzebra opened this issue Jul 3, 2018 · 7 comments
Labels
discussion An issue that requires a discussion docs An issue that affects the documentation

Comments

@halfzebra
Copy link
Owner

We have a few PRs introducing new configuration flags.

I'm afraid this is not the most user-friendly way to introduce some options in terms of configuration.

I'm proposing to remove the configuration flags, such as DEAD_CODE_ELIMINATION and stop using env variables for configuration(this might be a impossible to avoid in some cases, but the usage could be minimized)

Proposal

Create Elm App should allow the extension or modification of the Webpack configuration in a similar way to storybook.

Workflow

  1. Create .elmapp folder
  2. Add webpack.config.prod.js
  3. The rest of the functionality is described here: https://storybook.js.org/configurations/custom-webpack-config/

Potential

Make easier to address #246 #254

Target auditory

People who know Webpack, e.g. to address
#263 by @cdaringe
#262 by @tzemanovic

Please leave a comment on this issue if you have an opinion.

Further development

I'm thinking about introducing .elmapprc to address #160 and #255, the idea above might be or might not be a power-user tool to cover some edge-cases.

.elmapprc could introduce some high-level overrides, such as changing the output directory and other stuff similar to vue-cli.

Please share your thoughts if you have time and opinions on this @fobos @gyzerok @jackfranklin

@halfzebra halfzebra added discussion An issue that requires a discussion docs An issue that affects the documentation labels Jul 3, 2018
@halfzebra halfzebra changed the title Introduce a way for extending Webpack functionality Introduce a way for extending Webpack configurations Jul 3, 2018
@cdaringe
Copy link

cdaringe commented Jul 3, 2018

Whatever works. I like the idea of being able to provide a function to modify it.

@tzemanovic
Copy link
Contributor

This sounds great. I was thinking the same thing about the env vars when I opened #262 and since then I actually needed to add another custom config, so I would very much welcome this change.

@halfzebra
Copy link
Owner Author

Leaving this for a reference, here is a similar proposal for Create React App.

@halfzebra
Copy link
Owner Author

Vue Cli has a pretty good approach for Working with Webpack, it enables the extension and modification of the pre-packaged configuration from the config file.

As I have mentioned before, introducing a custom config file would make sense, because it seems like a future-proof way of introducing extendability.

@tzemanovic
Copy link
Contributor

Do you have any preference so far? Vue's approach looks quite powerful, but their internal webpack config is done with webpack-chain. I'd be happy to keep it simple by being able to provide my own prod config file with overrides like in the storybook, which seems like much less hassle, but I have no experience dealing with either of these.

@halfzebra
Copy link
Owner Author

Currently, I'm not considering using webpack-chain, because it's another layer of complexity for an API that is intended for confident Webpack users.

Plain Webpack config might be hard to work with, but it's the good old Webpack config instead of a new API to represent it.

Please let me know if that sounds reasonable 🙂

@tzemanovic
Copy link
Contributor

That was my thinking when I looked at webpack-chain 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion An issue that requires a discussion docs An issue that affects the documentation
Projects
None yet
Development

No branches or pull requests

3 participants