Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does maven (running under dev profile) include the javascript files inside index.html?

Tags:

jhipster

I haven't used jhipster since version 2.0 and I'm currently playing catch-up with version #4.0.6. When I try to build the initial app through "./mvnw" (with default dev maven profile) from the command line, the application javascript files are not added to the index.html (so that page comes up blank in my browser when I try http://localhost:8080). Could someone please explain me the normal chain of events which normally lead maven (running with the dev profile) to include the application javascript files into index.html ? Thank you very much in advance for your help. Best Regards kbjp

like image 279
user2038596 Avatar asked Dec 18 '22 09:12

user2038596


1 Answers

Our workflow is as below, yarn or npm will be used based on choice

  1. When you generate an app the files are generated and at the end it triggers yarn install task
  2. The postInstall script in package.json is triggered after yarn install, this step calls webpack:build task
  3. Now you should have all files generated and compiled into the www folder inside target or build folder based on build tool selected
  4. Now running mvnw or gradlew will launch the backend and should be available at localhost:8080 this should also serve the frontend compiled from above steps
  5. Now if you start making changes nothing will be reflected as its not compiled so you need to either run webpack:build:dev manually after changes or have yarn start running with live reload

Either you didn't let the postInstall script run or you deleted the target folder

You can also force maven to run webpack task while starting by passing the webpack profile like mvnw -Pdev,webpack

like image 73
Deepu Avatar answered Apr 28 '23 03:04

Deepu