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

I have not used jhipster since version 2.0, and now I am playing catch-up with version 4.0.6. When I try to create the source application via "./mvnw" (with the default maven profile dev ) from the command line, the application javascript files are not added to index.html (so that the page appears blank in my browser when trying to http: // localhost: 8080 ). Can someone explain to me the normal chain of events that maven usually leads (works with the dev profile ) to include application javascript files in index.html? Thank you in advance for your help. Best regards kbjp

+4
source share
3 answers

Our workflow, as indicated below, will use yarn or npm based on selection

  • When you create an application, files are generated and in the end it launches a task yarn install
  • postInstallthe script is package.jsonrun after yarn install, this step calls webpack:buildtask
  • Now you should have all the files generated and compiled into a folder wwwinside the folder targetor buildbased on the selected build tool
  • Now launched mvnwor gradlewwill launch the backend and should be accessible on localhost: 8080, this should also serve the interface compiled from the previous steps.
  • , , , , webpack:build:dev , yarn start

postInstall script,

maven webpack, webpack, mvnw -Pdev,webpack

+8

, gradle. Deepu answer . gradle webpackBuildDev ( www) , :

processResources {
  doLast {
    if (!new File("$buildDir/www").exists()) webpackBuildDev.exec()
  }
}

, , frontend-maven.

+1

The only command to create web resources (images, html, typescript, etc.) is

yarn webpack:build

This command will place web resources where they should be, i.e. build/www

0
source

Source: https://habr.com/ru/post/1670711/


All Articles