Build tools – webpack and BrowserSync

The client-side has evolved a lot and become as complex as the server-side, hence it requires a lot more tools in your toolbelt to produce optimized results. You need a build tool to transpile, minimize, and optimize your HTML, JavaScript, and CSS code. One of the most popular is webpack. JHipster uses webpack for Angular, React, and Vue.js.

Webpack (https://webpack.js.org) is a module bundler with a very flexible loader/plugin system. Webpack walks through the dependency graph and passes it through the configured loaders and plugins. With webpack, you can transpile TypeScript to JavaScript, minimize, and optimize CSS and JavaScript, compile SASS, revision, hash your assets, and so on. Webpack can remove dead code in a process called tree shaking, thus reducing bundle size. Webpack is configured using a configuration file and can be run from the command line or via NPM/Yarn scripts.

Then we have BrowserSync (https://browsersync.io), which is a Node.js tool that helps with browser testing by synchronizing file changes and interactions of the web page across multiple browsers and devices. It provides features such as auto-reload on file changes, synchronized UI interactions, synchronized scrolling, and so on. It integrates with webpack to provide a productive development setup. It makes testing a web page on multiple browsers and devices super easy.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.138.230