File tree Expand file tree Collapse file tree
spring-boot/thymeleaf-vue
java/io/reflectoring/thymeleafvue Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,8 +2,28 @@ plugins {
22 id " com.github.node-gradle.node" version " 2.2.4"
33}
44
5- task build (type : NpmTask ) {
5+ apply plugin : ' java'
6+
7+ group = ' io.reflectoring'
8+ version = ' 0.0.1-SNAPSHOT'
9+ sourceCompatibility = ' 11'
10+
11+ task npmBuild (type : NpmTask ) {
612 inputs. dir(" src" )
713 outputs. dir(" dist" )
814 args = [' run' , ' build' ]
9- }
15+ }
16+
17+ task npmClean (type : NpmTask ) {
18+ args = [' run' , ' clean' ]
19+ }
20+
21+ jar {
22+ into ' /static' , {
23+ from ' dist'
24+ include ' **/*.umd.min.js'
25+ }
26+ }
27+
28+ jar. dependsOn(' npmBuild' )
29+ clean. dependsOn(' npmClean' )
Original file line number Diff line number Diff line change 55 "scripts" : {
66 "serve" : " vue-cli-service serve" ,
77 "build" : " vue-cli-service build --target lib --dest dist/WeekChart --name WeekChart src/components/WeekChart.vue" ,
8+ "clean" : " rm -rf dist" ,
89 "lint" : " vue-cli-service lint" ,
910 "storybook" : " start-storybook -p 6006" ,
1011 "build-storybook" : " build-storybook" ,
Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ plugins {
66
77group = ' io.reflectoring'
88version = ' 0.0.1-SNAPSHOT'
9- sourceCompatibility = ' 1.8 '
9+ sourceCompatibility = ' 11 '
1010
1111repositories {
1212 mavenCentral()
1313}
1414
1515dependencies {
16- project(' :client' )
16+ implementation project(' :client' )
1717 implementation ' org.springframework.boot:spring-boot-starter-thymeleaf'
1818 implementation ' org.springframework.boot:spring-boot-starter-web'
1919 testImplementation(' org.springframework.boot:spring-boot-starter-test' ) {
@@ -24,16 +24,3 @@ dependencies {
2424test {
2525 useJUnitPlatform()
2626}
27-
28- task copyJavascriptComponents (type : Copy ) {
29- from ' ../client/dist'
30- include ' **/*.umd.min.js'
31- into ' src/main/resources/static/js/vue-components'
32- }
33-
34- task cleanJavascriptComponents (type : Delete ) {
35- delete ' src/main/resources/static/js/vue-components'
36- }
37-
38- processResources. dependsOn copyJavascriptComponents
39- clean. dependsOn cleanJavascriptComponents
Original file line number Diff line number Diff line change 1111@ Controller
1212class HelloVueController {
1313
14- @ GetMapping ("/hello " )
14+ @ GetMapping ("/" )
1515 ModelAndView showHelloPage () {
1616 Map <String , Object > model = new HashMap <>();
1717 model .put ("title" , "Hello Vue!" );
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ <h1 th:text="${title}">This title will be replaced</h1>
88</ div >
99
1010< script src ="https://unpkg.com/vue "> </ script >
11- < script th:src ="@{/js/vue-components/ WeekChart/WeekChart.umd.min.js} "> </ script >
11+ < script th:src ="@{/WeekChart/WeekChart.umd.min.js} "> </ script >
1212< script >
1313 ( function ( ) {
1414 new Vue ( {
You can’t perform that action at this time.
0 commit comments