fix : vue.js auto build code ADD
This commit is contained in:
23
build.gradle
23
build.gradle
@@ -2,6 +2,15 @@ plugins {
|
|||||||
id 'org.springframework.boot' version '2.7.3'
|
id 'org.springframework.boot' version '2.7.3'
|
||||||
id 'io.spring.dependency-management' version '1.0.13.RELEASE'
|
id 'io.spring.dependency-management' version '1.0.13.RELEASE'
|
||||||
id 'java'
|
id 'java'
|
||||||
|
id "com.github.node-gradle.node" version "3.1.1"
|
||||||
|
}
|
||||||
|
|
||||||
|
node {
|
||||||
|
version = '14.15.4'
|
||||||
|
npmVersion = '6.14.10'
|
||||||
|
workDir = file("./src/frontend")
|
||||||
|
npmWorkDir = file("./src/frontend")
|
||||||
|
nodeModulesDir = file("./src/frontend")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = 'com.io'
|
group = 'com.io'
|
||||||
@@ -42,3 +51,17 @@ dependencies {
|
|||||||
tasks.named('test') {
|
tasks.named('test') {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task setUp(type: NpmTask){
|
||||||
|
description = "Install Node.js packages!"
|
||||||
|
args = ['install']
|
||||||
|
inputs.files file('package.json')
|
||||||
|
outputs.files file('node_modules');
|
||||||
|
}
|
||||||
|
|
||||||
|
task buildFrontEnd(type: NpmTask, dependsOn: setUp){
|
||||||
|
description = "Build Vue.js"
|
||||||
|
args = ['run', 'build']
|
||||||
|
}
|
||||||
|
|
||||||
|
processResources.dependsOn 'buildFrontEnd'
|
||||||
@@ -34,7 +34,7 @@ public class WebConfig {
|
|||||||
public SecurityFilterChain resources(HttpSecurity http) throws Exception {
|
public SecurityFilterChain resources(HttpSecurity http) throws Exception {
|
||||||
http.csrf().disable()
|
http.csrf().disable()
|
||||||
.requestMatchers((matchers) -> {matchers.antMatchers("/h2-console/**");
|
.requestMatchers((matchers) -> {matchers.antMatchers("/h2-console/**");
|
||||||
matchers.antMatchers(HttpMethod.GET,"/api/articles/**");})
|
matchers.antMatchers(HttpMethod.GET,"/api/articles/**","/");})
|
||||||
.authorizeHttpRequests((authorize) -> authorize.anyRequest().permitAll())
|
.authorizeHttpRequests((authorize) -> authorize.anyRequest().permitAll())
|
||||||
.requestCache().disable()
|
.requestCache().disable()
|
||||||
.securityContext().disable()
|
.securityContext().disable()
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
hello
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user