-
legacy code: https://github.com/zirho/webpack-to-legacy/tree/master
-
refactored: https://github.com/zirho/webpack-to-legacy/tree/1-add-new-entry-file
-
external package: https://github.com/zirho/webpack-to-legacy/tree/2-use-external-package
This repo is for my blog post, showing how to refactor legacy js code with webpack.
What I want to demonstrate are...
-
Refactoring this web app, currently using global scope functions.
-
Making it use ES6 syntax, also use external npm packages.
-
Using HMR(hot module replacement) with webpack
$ git clone https://github.com/zirho/webpack-to-legacy.git webpack-to-legacy
$ npm i
$ npm run dev
and navigate to see web app in another termial window or tab
$ open http://localhost:8080