
"This blog post is part of the series "Learning web development" - which teaches people who have never programmed how to create web apps with JavaScript. To download the projects, go to the GitHub repository learning-web-dev-code and follow the instructions there. I'm interested in feedback! If there is something you don't understand, please write a comment at the end of this page. In this chapter we develop a small web app in the same way that large professional web apps are developed:"
"Output: build/ contains the final web app that is complete and ready to be served. Input: html/ contains HTML files that are copied to build/. js/ contains JavaScript files that, along with npm library code that we use, is bundled into the single file build/bundle.js. The project word-guessing-game is itself an npm package: Roughly, any directory with a package.json file is an npm package. It benefits from the ability of a package to install other packages inside itself and use them."
The development approach uses npm packages, tests, and bundling to produce a single JavaScript bundle for serving. Projects include a package.json manifest and install dependencies into node_modules. Source HTML and JS live in html/ and js/ and are copied or bundled into the build/ directory as the final app. The bundled output is build/bundle.js, which combines application code and npm library code. A project directory with package.json is itself an npm package and can install and use other packages. The build step introduces a downside of maintaining two application versions (source and built).
Read at 2ality
Unable to calculate read time
Collection
[
|
...
]