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

Webpack 5 Support / Refactoring #64

Merged
merged 1 commit into from
Feb 21, 2021
Merged

Webpack 5 Support / Refactoring #64

merged 1 commit into from
Feb 21, 2021

Conversation

web-mi
Copy link
Collaborator

@web-mi web-mi commented Feb 20, 2021

I have refactored the code a little bit and added support for webpack 5 but webpack 4 is still be supported.
Maybe it should be released as major but it should not include any breaking changes.

  • Webpack 5 support
  • Refactored logic from prototype class to class
  • Switched from done hook to afterEmit because webpack v5 shrinks assets to SizeOnlySource Changelog
  • Added config validation
  • Restructured options from single attributes to options attribute

Fixes #63

Copy link
Owner

@statianzo statianzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Webpack 5 and some much needed modernization. 🎉

Thank you @web-mi 🙏

It's worth cutting a new major because of the options validation and modern ES syntax.

index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@web-mi
Copy link
Collaborator Author

web-mi commented Feb 20, 2021

@statianzo could you tell me why you unset delay option for tiny-lr?
I could not find any usage of delay in tiny-lr but won't remove it because i don't know why you removed it.

- Refactored logic from prototype class to class
- Switched from done hook to afterEmit because webpack v5 shrinks assets to SizeOnlySource
- Added config validation
- Restructured options from single attributes to options attribute
- Adding webpack as peerDependency and node > 10 as engine
- Removed webpack 3 support
@web-mi
Copy link
Collaborator Author

web-mi commented Feb 20, 2021

Changes are done.
I refactored the listen function a little bit.
The package.json now includes the peerDependency for webpack and engines for node version.
And i have added a changelog file.

I tried everything with node 10 too and it works so required node version is >= 10.

@statianzo
Copy link
Owner

@statianzo could you tell me why you unset delay option for tiny-lr?
I could not find any usage of delay in tiny-lr but won't remove it because i don't know why you removed it.

It came as part of #38. Likely being conservative about what gets passed through to tiny-lr, to prevent issues if it were to add delay.

@statianzo statianzo merged commit 782977b into statianzo:master Feb 21, 2021
@statianzo
Copy link
Owner

Released v3.0.0. Switched to github actions for CI because travis seems to no longer run.

Thanks again @web-mi

@web-mi web-mi deleted the webpack-5-support branch February 21, 2021 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webpack 5 support?
2 participants