-
Notifications
You must be signed in to change notification settings - Fork 160
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 4 example #53
Conversation
@ggetz I wasn't totally sure the best place to do linting so right now it's in each directory as a "complete package" but it may make more sense to still initialize the whole project as a npm project and do it only at the top level? I haven't worked with npm workspaces or anything but would that make more sense here? I also realized that this method may not work with |
@ggetz I restructured the packages a little pulling eslint, prettier and husky up to the top level as discussed this morning. I tried using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jjspace! The new example is working well 👍 I think it makes sense to continue with this approach.
Thanks for the comments @ggetz, I've addressed or responded to them all, please take another look |
@ggetz updated again, I reorganized the main readme to avoid confusion |
Awesome. Thanks @jjspace! |
This PR adds a separate example for Webpack version 4 alongside Webpack 5. Ideally most people should be on version 5 as soon as possible and on all new products. However, older projects or ones using older versions of frameworks like Nuxt2 and older Angular versions still rely on Webpack version 4
There are some challenges wrapped in getting this to work for Webpack 4 which mostly stem from using newer JS features that Webpack doesn't know how to support.
babel
for transformations like optional chaining (.?
)import.meta
(@open-wc/webpack-import-meta-loader
)I also updated the github actions to make sure to perform the build checks and linting against both webpack 4 and 5 versions.
Testing
webpack-4
andwebpack-5
directoriesnpm install
npm run build
npm start
and make sure the page works correctly at http://localhost:8080/npm run start:built
and make sure the page works correctly at http://localhost:8080/There should not be any errors in the console or on the page for both version 4 and 5