nav icon indicating copy to clipboard operation
nav copied to clipboard

Build frontend with Webpack

Open podliashanyk opened this issue 2 years ago • 0 comments

Todays solution:

All .js files are loaded, regardless of what view user interacts with. Builds are therefore slow and chunky from user's perspective. When modifying frontend code, running docker-compose build is not sufficient for all changes to be rolled out so that developer can inspect changes manually in the browser. This is also due to build being slow and chunky. Furthermore, the time for when all of the changes are going to be reflected in the build, is unpredictable. This, naturally, slows downs the development and maintenance of the frontend code significantly.

Suggested solution:

Use webpack for building frontend. It is highly recommended to fix #2473 first.

Alternative solutions:

There ale alternative building systems - Grunt and gulp, but webpack is more sufficient. webpack covers more use cases that Grunt and gulp cover when combined.

Drawbacks: Introducing webpack to an existing code base requires good understanding of how builds work, as well as high competence in building with webpack specifically. This is not a light-weight task, and is furthermore technically challenging.

Credit: The issue was suggested, and extensively described by @emilhf in Forslag til ny frontend-tilnærming I NAV [May 2017]

podliashanyk avatar Aug 22 '22 07:08 podliashanyk