阿超
>
frontend-maven-plugin
没有目标而生活,恰如没有罗盘而航行。——康德
分享一个前端maven
打包插件:frontend-maven-plugin
https://github.com/eirslett/frontend-maven-plugin
例如streampark
中使用的:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| <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>
|