Converting flow application to npm mode

Hi all,

I would like to start my application (and add-on component) in npm mode.

My original goal is to use a polymer component that I made earlier, and use it as a dependency in the Vaadin Add-On project (npm dependency, I suppose). And then the Vaadin add-on would be used in the main application (maven dep).

However when running the add-on component (mvn jetty:run) I get the message that I should convert my app to npm mode. Now it came to my knowledge, that the beverage sample app: https://github.com/vaadin/beverage-starter-flow should be configured to run in npm mode, but what are the key points for that?

Hi.

There is no exact steps to take documentation at the time, but the steps are basically to add to the application pom.xml <build> the vaadin-maven-plugin with the prepare-frontend and build-frontend goals.

E.g.

            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>${vaadin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-frontend</goal>
                            <goal>build-frontend</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

This should create the needed settings files and have make the server use npm instead of bower.

I would suggest to wait for a day or 2 for 14.0.0.beta3 as it will change how the modes are caught
and fix many issues found in beta2.

  • Mikael

Mikael Grankvist:
Hi.

There is no exact steps to take documentation at the time, but the steps are basically to add to the application pom.xml <build> the vaadin-maven-plugin with the prepare-frontend and build-frontend goals.

E.g.

            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>${vaadin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-frontend</goal>
                            <goal>build-frontend</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

This should create the needed settings files and have make the server use npm instead of bower.

I would suggest to wait for a day or 2 for 14.0.0.beta3 as it will change how the modes are caught
and fix many issues found in beta2.

  • Mikael

Thanks!

To anyone else having this question, there is an article to read at https://vaadin.com/tutorials/migrate-from-bower-to-npm-for-vaadin-14+