Tag Archives: webpack

Convert react app built with frontend-maven-plugin from webpack to vite

The frontend-karaf-demo project is a maven project that builds a jar file containing a servlet and compiles a react application, with frontend-maven-plugin, into static files that can be added to the jar file’s classpath and be served by the servlet.

With the frontend-maven-plugin, building a webapp can be integrated into a maven build, without the builder having to download and install node.js. The frontend-maven-plugin downloads its own node.js to handle npm depdencies and do the build.

This bloggpost describes the things I had to do, to convert the webapp build in this setup from webpack to vite.

Note: to follow this recipe npm must be installed (but it is possible to achieve the same effects by manually editing package.json). Continue reading Convert react app built with frontend-maven-plugin from webpack to vite

Trying out Tailwind CSS on a react webapp

Introduction

On November 11 2021 I put trying out tailwindcss on my personal TODO list.

In January 2024 I got around to trying out tailwindcss on a react.js web application and this blogpost first describes how I used it and then what I think about it.

The application used in the tailwind test

The test bed for trying out Tailwind CSS was my smallest real application, handlereg. This is an application for tracking grocery purchases. What’s tracked for each purchase is the date, the store and the amount.

Before trying out Tailwind CSS, the application was styled with Bootstrap v5 (and just recently upgraded from Bootstrap v4).

Here is the main page of the handlereg webapp styled with Tailwind CSS. Continue reading Trying out Tailwind CSS on a react webapp

A Java programmer’s guide to delivering webapp frontends

When I started investigating (googling) web frontends, I found tutorials for various frameworks and I found tutorials using node.js to deliver frontends to web browsers on localhost.

What I did not find, was something telling me how I should pack up and deliver the webapp frontend from my production system, so that comes here:

  1. A web application frontend  is a piece of javascript code, that builds its user interface by rebuilding the DOM tree of the webpage that loaded it
  2. The javascript needed for a webapp is packaged up as a big javascript file, typically named bundle.js,
  3. The initial HTML file references bundle.js
  4. The initial HTML file also contains an element that matches what the javascript code expects to be its start element (i.e. the point in the DOM of the parsed HTML file, where the javascript program starts rebuilding its own DOM)

Continue reading A Java programmer’s guide to delivering webapp frontends