Forráskód Böngészése

Feature: add production profile to minify resources

fecaille 9 éve
szülő
commit
c43fdf9f95
2 módosított fájl, 29 hozzáadás és 10 törlés
  1. 2 1
      package.json
  2. 27 9
      pom.xml

+ 2 - 1
package.json

@@ -25,7 +25,8 @@
   },
   "scripts": {
   	"dev": "webpack-dev-server --hot --inline --devtool eval --progress --colors --content-base build --port 9999",
-  	"dev-build": "webpack -d --display-modules",
+  	"dev-build": "webpack -d --progress --colors",
+  	"prod-build": "webpack -d -p --colors",
     "watch": "webpack --watch -d"
   }
 }

+ 27 - 9
pom.xml

@@ -21,6 +21,7 @@
 
 	<properties>
 		<java.version>1.8</java.version>
+		<packaging.type>war</packaging.type>
 		<maven.deploy.skip>true</maven.deploy.skip>
 		<project.scm.id>jazzhub</project.scm.id>
 		<docker.image.prefix>opensaas</docker.image.prefix>
@@ -128,15 +129,6 @@
 	</build>
 	
 	<profiles>
-		<profile>
-			<id>webapp</id>
-			<activation>
-			<activeByDefault>true</activeByDefault>
-			</activation>
-			<properties>
-				<packaging.type>war</packaging.type>
-			</properties>
-		</profile>
 		<profile>
 			<id>docker</id>
 			<properties>
@@ -175,6 +167,32 @@
 	            </plugins>
             </build>
 		</profile>
+		<profile>
+			<id>production</id>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>com.github.eirslett</groupId>
+						<artifactId>frontend-maven-plugin</artifactId>
+						<version>0.0.29</version>
+						<configuration>
+							<workingDirectory>${project.build.directory}</workingDirectory>
+						</configuration>
+						<executions>
+							<execution>
+								<goals>
+		                            <goal>npm</goal>
+		                        </goals>
+		                        <phase>generate-resources</phase>
+		                        <configuration>
+		                            <arguments>run-script prod-build</arguments>
+		                        </configuration>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
 	</profiles>
 	
 </project>