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

Enhancement: Init generator improvements #814

Closed
2 of 3 tasks
misterdev opened this issue Mar 31, 2019 · 2 comments · Fixed by #817
Closed
2 of 3 tasks

Enhancement: Init generator improvements #814

misterdev opened this issue Mar 31, 2019 · 2 comments · Fixed by #817

Comments

@misterdev
Copy link
Contributor

misterdev commented Mar 31, 2019

What is the current behavior?
The init generator executed while running webpack-cli init creates a webpack configuration file and installs the dependencies, I think it could be improved:

  • There are some unused imports and comments in the generated configuration file
  • The keys in the configuration object are in a random order, IMO this should be an example of good practices for beginners
  • The entry point provided by the user is never set in the final configuration file
  • We check many times a variable isProd that is initialized to false and never updated
  • The code could be refactored, topScope and webpackOptions are initialized sparsely
  • When multientry configuration is chosen we suggest naming the entries "app" and "vendor", this seems to be discouraged in v4

What is the expected behavior?

  • generate some boilerplate too (eg. generate the entry point in src/index.js)
  • cleaner code
  • cleaner configuration with ordered keys

I think this would benefit the programmatic usage too.

I'm already working on this, please let me know any opinion and if you think there's something else that can be improved :)

@misterdev misterdev changed the title Init generator could be improved Init generator improvements Mar 31, 2019
@pranshuchittora
Copy link
Member

pranshuchittora commented Apr 2, 2019

@misterdev I would like to work on this. Is there any PR regarding this ?

@misterdev
Copy link
Contributor Author

That's nice :) At the moment I have a branch for this but I'm working on other things, I'll open a PR soon.

@evenstensberg evenstensberg changed the title Init generator improvements Enhancement: Init generator improvements Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants