Pārlūkot izejas kodu

Finished packaging the client/angular stuff as a webjar, and updated the server side to make use of it.

James Albright 8 gadi atpakaļ
vecāks
revīzija
b5f7e608ad

+ 1 - 0
.gitignore

@@ -2,3 +2,4 @@
 /pwm.iml
 /client/target
 /client/pwm-client.iml
+/client/.node

+ 1 - 0
client/package.json

@@ -36,6 +36,7 @@
     "fontgen-loader": "0.2.1",
     "html-loader": "0.4.4",
     "html-webpack-plugin": "2.22.0",
+    "ignore-loader": "0.1.2",
     "jasmine": "2.5.2",
     "jshint": "2.9.3",
     "jshint-loader": "0.8.3",

+ 2 - 2
client/pom.xml

@@ -31,7 +31,7 @@
                             <goal>copy-resources</goal>
                         </goals>
                         <configuration>
-                            <outputDirectory>${project.build.outputDirectory}/META-INF/resources/webjars/pwm-client</outputDirectory>
+                            <outputDirectory>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${project.version}</outputDirectory>
                             <resources>
                                 <resource>
                                     <directory>dist</directory>
@@ -68,7 +68,7 @@
                 <configuration>
                     <nodeVersion>v6.6.0</nodeVersion>
                     <npmVersion>3.10.8</npmVersion>
-                    <installDirectory>target</installDirectory>
+                    <installDirectory>.node</installDirectory>
                 </configuration>
                 <executions>
                     <execution>

+ 4 - 2
client/webpack.build.js

@@ -35,8 +35,10 @@ module.exports = webpackMerge(commonConfig, {
             {
                 test: /icons\.json$/,
                 loaders: [
-                    'style',
-                    'raw',
+                    'ignore',
+                    // Need to output to an external file, since fontgen consolidates: "../.." into: "../", even after
+                    // doing the string-replace below.  This is a problem, since we're loading from a webjar now.
+                    'file?name=fonts.css',
                     // This replaces path from app root so the urls are relative to the output directory
                     'string-replace?search=url%5C("%5C/&replace=url("./&flags=gm',
                     'fontgen?fileName=fonts/[fontname]-[hash][ext]'

+ 2 - 1
server/src/main/webapp/WEB-INF/jsp/peoplesearch.jsp

@@ -44,7 +44,8 @@
 
 <%@ include file="fragment/footer.jsp" %>
 <pwm:script-ref url="/public/resourcess/js/peoplesearch.js" />
-<pwm:script-ref url="/public/resourcess/app/peoplesearch.ng.js" />
+<link rel="stylesheet" type="text/css" href="<pwm:url url='/public/resources/webjars/pwm-client/fonts.css' addContext="true"/>"/>
+<pwm:script-ref url="/public/resources/webjars/pwm-client/peoplesearch.ng.js" />
 
 </body>
 </html>