I had success making one module root project working with no problem (mostly).
Now i can not figure it out , how to configure multi-module project with vaadin 14 and npm.
Structure :
root
2) BL (jpa, ws, etc,…) → jar
3) DATA (entity, pojos,…) → jar
4) CLIENT (client for app ws) → jar
5) UI (vaadin 14 ui, npm, frontend,…) → war (including jar from 2 and 3)
I have frontend folder in root project which should be OK. But then i got problem with npm and node_modules.
Now my questions:
Wherte to put package.json ?
In which pom.xml do i need prepare-frontend, production profile etc ,… ?
JavaOPs Empty:
In case of several UI моdules (several application) in multi module Vaadin project, is there a possibility to share node_modules and package*.json?
I’m not sure if I understand the question, but if you have multiple modules and run only 1 application (with jetty or spring-boot… ), you should have only 1 package*.json and mode_modules.
If you run multiple applications, then the node_modules + package*.json should be different.
Hello Jean-Christophe!
I’ve multiple applications. And a lot of duplication in every node_modules.
I’ve try pnpm (https://vaadin.com/docs/v14/flow/advanced/tutorial-switch-npm-pnpm.html, use 14.4.5 version), but node_modules still created for every application. I’ve used NTFS links as workaround, but I hope should be a solution for sharing this multiple node_modules.