分享一个前端maven
打包插件:frontend-maven-plugin
https://github.com/eirslett/frontend-maven-plugin
例如streampark
中使用的:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<configuration>
<workingDirectory>${project.basedir}/../${frontend.project.name}</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and pnpm</id>
<goals>
<goal>install-node-and-pnpm</goal>
</goals>
<configuration>
<nodeVersion>v16.16.0</nodeVersion>
<pnpmVersion>7.3.0</pnpmVersion>
</configuration>
</execution>
<execution>
<id>install</id>
<goals>
<goal>pnpm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install --ignore-scripts</arguments>
</configuration>
</execution>
<execution>
<id>build</id>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>run build:no-cache</arguments>
</configuration>
</execution>
</executions>
</plugin>