-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.js
More file actions
33 lines (23 loc) · 1 KB
/
build.js
File metadata and controls
33 lines (23 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var
shell = require('shelljs'),
path = require('path')
const { execSync } = require('child_process')
//clean build
shell.rm('-rf', path.resolve(__dirname, 'dist/*'))
shell.rm('-rf', path.resolve(__dirname, 'dist/.*'))
shell.rm('-rf', path.resolve(__dirname, 'backend/wwwroot/*'))
shell.rm('-rf', path.resolve(__dirname, 'backend/wwwroot/.*'))
shell.rm('-rf', path.resolve(__dirname, 'backend/bin/*'))
shell.rm('-rf', path.resolve(__dirname, 'backend/bin/.*'))
console.log('Cleaned build artifacts.\n')
//build quasar
shell.exec("quasar build --clean")
//Copy quasar build to .net core, and build
shell.cp('-rf', 'dist/spa-mat/.', 'backend/wwwroot')
shell.exec('dotnet publish ./backend')
//Delete app settings
var dotNetBuildPath = 'backend/bin/Debug/netcoreapp2.0/publish/'
shell.rm('-f', path.join(dotNetBuildPath, 'appsettings.Development.json'))
shell.rm('-f', path.join(dotNetBuildPath, 'appsettings.Test.json'))
shell.rm('-f', path.join(dotNetBuildPath, 'appsettings.json'))
console.log("Build complete")