Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

java - Angular primeicons not shown - Angular and Spring project

Hi im using PrimeNg in my project, when i run it with ng serve it works well and icons are shown well, when i build the project and deploy it on WLS with spring project the icons becomes into squares but all the styles (of PrimeNG) works well. I think is related on WLS configuration, can you help me please?

angular.json

...
  "styles": [
              "./node_modules/primeflex/primeflex.css",
              "./node_modules/primeicons/primeicons.css",
              "./node_modules/primeng/resources/primeng.min.css",
              "./node_modules/primeng/resources/themes/nova-colored/theme.css",
              "src/styles.css" 
            ],
...

package.json

...
  "primeflex": "^1.3.1",
    "primeicons": "^1.0.0",
    "primeng": "^7.1.0"
...

pom.xml (JAVA)

<groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <workingDirectory>src/main/angular</workingDirectory>
                    <installDirectory>target</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>v12.7.0</nodeVersion>
                            <npmVersion>6.10.0</npmVersion>
                        </configuration>
                    </execution>

                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
           
                    <execution>
                        <id>npm run build</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run build</arguments>
                        </configuration>
                    </execution>                    
                </executions>
            </plugin>

...

When the final war file is created, i can see the fonts (primeicons) and primeicons styles in styles.js, so i don't know what is happening.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...