refactor to package the Vue components into the JAR instead of copying files around

This commit is contained in:
Tom Hombergs
2020-07-26 20:55:39 +10:00
parent 44fe1a4945
commit c35f171d32
5 changed files with 27 additions and 19 deletions

View File

@@ -2,8 +2,28 @@ plugins {
id "com.github.node-gradle.node" version "2.2.4"
}
task build(type: NpmTask) {
apply plugin: 'java'
group = 'io.reflectoring'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
task npmBuild(type: NpmTask) {
inputs.dir("src")
outputs.dir("dist")
args = ['run', 'build']
}
}
task npmClean(type: NpmTask) {
args = ['run', 'clean']
}
jar {
into '/static', {
from 'dist'
include '**/*.umd.min.js'
}
}
jar.dependsOn('npmBuild')
clean.dependsOn('npmClean')

View File

@@ -5,6 +5,7 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build --target lib --dest dist/WeekChart --name WeekChart src/components/WeekChart.vue",
"clean": "rm -rf dist",
"lint": "vue-cli-service lint",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",