refactor(build): add separate admin source ts location

This commit is contained in:
Oliver Booth 2024-02-26 00:45:00 +00:00
parent 97170dcb44
commit aae7f504e9
Signed by: oliverbooth
GPG Key ID: E60B570D1B7557B5
13 changed files with 38 additions and 10 deletions

View File

@ -5,6 +5,8 @@ const rename = require("gulp-rename");
const ts = require("gulp-typescript"); const ts = require("gulp-typescript");
const terser = require("gulp-terser"); const terser = require("gulp-terser");
const webpack = require("webpack-stream"); const webpack = require("webpack-stream");
const path = require("path");
const named = require("vinyl-named");
const srcDir = "src"; const srcDir = "src";
const destDir = "OliverBooth/wwwroot"; const destDir = "OliverBooth/wwwroot";
@ -25,8 +27,9 @@ function compileTS() {
} }
function bundleJS() { function bundleJS() {
return gulp.src("tmp/js/*.js") return gulp.src(["tmp/js/*.js", "tmp/js/app/app.js", "tmp/js/admin/admin.js"])
.pipe(webpack({ mode: "production", output: { filename: "app.min.js" } })) .pipe(named())
.pipe(webpack({ mode: "production", output: { filename: "[name].min.js" } }))
.pipe(gulp.dest(`${destDir}/js`)); .pipe(gulp.dest(`${destDir}/js`));
} }

View File

@ -26,15 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scss", "scss", "{822F528E-3
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ts", "ts", "{BB9F76AC-292A-4F47-809D-8BBBA6E0A048}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ts", "ts", "{BB9F76AC-292A-4F47-809D-8BBBA6E0A048}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
src\ts\app.ts = src\ts\app.ts
src\ts\prism.js = src\ts\prism.js src\ts\prism.js = src\ts\prism.js
src\ts\API.ts = src\ts\API.ts
src\ts\BlogPost.ts = src\ts\BlogPost.ts
src\ts\Author.ts = src\ts\Author.ts
src\ts\TimeUtility.ts = src\ts\TimeUtility.ts
src\ts\UI.ts = src\ts\UI.ts
src\ts\Input.ts = src\ts\Input.ts
src\ts\BlogUrl.ts = src\ts\BlogUrl.ts
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "img", "img", "{8996BEBA-0D9C-4D76-9117-8E4E89148A1A}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "img", "img", "{8996BEBA-0D9C-4D76-9117-8E4E89148A1A}"
@ -45,6 +37,23 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "img", "img", "{8996BEBA-0D9
src\img\oliverbooth-704x330.png = src\img\oliverbooth-704x330.png src\img\oliverbooth-704x330.png = src\img\oliverbooth-704x330.png
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "admin", "admin", "{183CDB1F-371D-4A24-8F96-1DF0967995E4}"
ProjectSection(SolutionItems) = preProject
src\ts\admin\admin.ts = src\ts\admin\admin.ts
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "app", "app", "{A6590915-CB40-43EA-B0A3-EDEC63769780}"
ProjectSection(SolutionItems) = preProject
src\ts\app\API.ts = src\ts\app\API.ts
src\ts\app\app.ts = src\ts\app\app.ts
src\ts\app\Author.ts = src\ts\app\Author.ts
src\ts\app\BlogPost.ts = src\ts\app\BlogPost.ts
src\ts\app\BlogUrl.ts = src\ts\app\BlogUrl.ts
src\ts\app\Input.ts = src\ts\app\Input.ts
src\ts\app\TimeUtility.ts = src\ts\app\TimeUtility.ts
src\ts\app\UI.ts = src\ts\app\UI.ts
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -60,5 +69,7 @@ Global
{822F528E-3CA7-4B7D-9250-BD248ADA7BAE} = {8A323E64-E41E-4780-99FD-17BF58961FB5} {822F528E-3CA7-4B7D-9250-BD248ADA7BAE} = {8A323E64-E41E-4780-99FD-17BF58961FB5}
{BB9F76AC-292A-4F47-809D-8BBBA6E0A048} = {8A323E64-E41E-4780-99FD-17BF58961FB5} {BB9F76AC-292A-4F47-809D-8BBBA6E0A048} = {8A323E64-E41E-4780-99FD-17BF58961FB5}
{8996BEBA-0D9C-4D76-9117-8E4E89148A1A} = {8A323E64-E41E-4780-99FD-17BF58961FB5} {8996BEBA-0D9C-4D76-9117-8E4E89148A1A} = {8A323E64-E41E-4780-99FD-17BF58961FB5}
{183CDB1F-371D-4A24-8F96-1DF0967995E4} = {BB9F76AC-292A-4F47-809D-8BBBA6E0A048}
{A6590915-CB40-43EA-B0A3-EDEC63769780} = {BB9F76AC-292A-4F47-809D-8BBBA6E0A048}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

13
package-lock.json generated
View File

@ -17,6 +17,7 @@
"gulp-typescript": "^6.0.0-alpha.1", "gulp-typescript": "^6.0.0-alpha.1",
"sass": "^1.69.5", "sass": "^1.69.5",
"terser": "^5.19.2", "terser": "^5.19.2",
"vinyl-named": "^1.1.0",
"webpack-stream": "^7.0.0" "webpack-stream": "^7.0.0"
} }
}, },
@ -4953,6 +4954,18 @@
"xtend": "~4.0.1" "xtend": "~4.0.1"
} }
}, },
"node_modules/vinyl-named": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/vinyl-named/-/vinyl-named-1.1.0.tgz",
"integrity": "sha512-ElYBnsSw8Y1Hz11WPw0DFmi+TBNTEBhZ9zXaHluDSIZZnkFIGCjGRBpsW5QmbMMLwv+lRpUD3VbKdJCbNpct7Q==",
"dev": true,
"dependencies": {
"through": "^2.3.6"
},
"engines": {
"node": ">= 0.10.0"
}
},
"node_modules/vinyl-sourcemap": { "node_modules/vinyl-sourcemap": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz",

View File

@ -27,6 +27,7 @@
"gulp-typescript": "^6.0.0-alpha.1", "gulp-typescript": "^6.0.0-alpha.1",
"sass": "^1.69.5", "sass": "^1.69.5",
"terser": "^5.19.2", "terser": "^5.19.2",
"vinyl-named": "^1.1.0",
"webpack-stream": "^7.0.0" "webpack-stream": "^7.0.0"
} }
} }

0
src/ts/admin/admin.ts Normal file
View File