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 'io.spring.dependency-management' version '1.0.13.RELEASE'
|
||||
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'
|
||||
@@ -42,3 +51,17 @@ dependencies {
|
||||
tasks.named('test') {
|
||||
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 {
|
||||
http.csrf().disable()
|
||||
.requestMatchers((matchers) -> {matchers.antMatchers("/h2-console/**");
|
||||
matchers.antMatchers(HttpMethod.GET,"/api/articles/**");})
|
||||
matchers.antMatchers(HttpMethod.GET,"/api/articles/**","/");})
|
||||
.authorizeHttpRequests((authorize) -> authorize.anyRequest().permitAll())
|
||||
.requestCache().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