java - 使用 Maven 可以实现角度延迟加载模块
问题描述
我正在使用 maven 多模块项目来创建 war 文件以集成 angular 和 spring-boot 应用程序。是否可以使用 maven 进行延迟加载功能模块块?这是我的前端 pom.xml:
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.abc</groupId>
<artifactId>ParentDashboard</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>Frontend</artifactId>
<name>Frontend</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<nodeVersion>v10.16.3</nodeVersion>
<npmVersion>6.9.0</npmVersion>
<workingDirectory>src/main/web/</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm install --production</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
<execution>
<id>prod</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run-script build</arguments>
</configuration>
<phase>generate-resources</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
我可以看到在 Visual Studio 代码中创建的块,但是使用这个 Maven 配置,我在 Eclipse 控制台中看不到块。有人能帮忙吗?
解决方案
似乎我已经使用 package.json 中的以下配置解决了它。
"build": "ng build --prod --aot --base-href=\"./\"".
现在我可以看到在 Eclipse 控制台中创建的单个模块块,并在 devTools 网络控制台中看到块。
推荐阅读
- macos - 在哪里可以找到 Apple M1 的 Metal 功能集?
- node.js - 使用passport js的多用户类型认证(用户和教师)
- reactjs - 使用frontity时,在编辑器中更改源代码,浏览器显示原始内容
- python - 如何在python中将数字转换为紧凑格式以进行图表?
- conda - 无法使用 conda 安装 htslib v1.12
- ruby-on-rails-6 - 如何从 Webpacker 5.2.1 升级到 6.0.0.beta.7?
- java - 如果我的文件中的数据包含值的分隔符 (ç),该怎么办
- node.js - “参数类型错误”与拉猫鼬更新数组
- android - 如何在实际完全加载视频之前开始在 MediaPlayer 中播放视频
- java - Android:对多个通知使用一个服务类?