diff --git a/Gulpfile.js b/Gulpfile.js index 2eb9aec..31718ab 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -5,6 +5,8 @@ const rename = require("gulp-rename"); const ts = require("gulp-typescript"); const terser = require("gulp-terser"); const webpack = require("webpack-stream"); +const path = require("path"); +const named = require("vinyl-named"); const srcDir = "src"; const destDir = "OliverBooth/wwwroot"; @@ -25,8 +27,9 @@ function compileTS() { } function bundleJS() { - return gulp.src("tmp/js/*.js") - .pipe(webpack({ mode: "production", output: { filename: "app.min.js" } })) + return gulp.src(["tmp/js/*.js", "tmp/js/app/app.js", "tmp/js/admin/admin.js"]) + .pipe(named()) + .pipe(webpack({ mode: "production", output: { filename: "[name].min.js" } })) .pipe(gulp.dest(`${destDir}/js`)); } diff --git a/OliverBooth.sln b/OliverBooth.sln index c17858e..a2b5dc8 100644 --- a/OliverBooth.sln +++ b/OliverBooth.sln @@ -26,15 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scss", "scss", "{822F528E-3 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ts", "ts", "{BB9F76AC-292A-4F47-809D-8BBBA6E0A048}" ProjectSection(SolutionItems) = preProject - src\ts\app.ts = src\ts\app.ts 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 EndProject 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 EndProjectSection 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 GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -60,5 +69,7 @@ Global {822F528E-3CA7-4B7D-9250-BD248ADA7BAE} = {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} + {183CDB1F-371D-4A24-8F96-1DF0967995E4} = {BB9F76AC-292A-4F47-809D-8BBBA6E0A048} + {A6590915-CB40-43EA-B0A3-EDEC63769780} = {BB9F76AC-292A-4F47-809D-8BBBA6E0A048} EndGlobalSection EndGlobal diff --git a/package-lock.json b/package-lock.json index 0470d13..3d2a1e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "gulp-typescript": "^6.0.0-alpha.1", "sass": "^1.69.5", "terser": "^5.19.2", + "vinyl-named": "^1.1.0", "webpack-stream": "^7.0.0" } }, @@ -4953,6 +4954,18 @@ "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": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", diff --git a/package.json b/package.json index acf5a43..f1f04d7 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "gulp-typescript": "^6.0.0-alpha.1", "sass": "^1.69.5", "terser": "^5.19.2", + "vinyl-named": "^1.1.0", "webpack-stream": "^7.0.0" } } diff --git a/src/ts/admin/admin.ts b/src/ts/admin/admin.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/ts/API.ts b/src/ts/app/API.ts similarity index 100% rename from src/ts/API.ts rename to src/ts/app/API.ts diff --git a/src/ts/Author.ts b/src/ts/app/Author.ts similarity index 100% rename from src/ts/Author.ts rename to src/ts/app/Author.ts diff --git a/src/ts/BlogPost.ts b/src/ts/app/BlogPost.ts similarity index 100% rename from src/ts/BlogPost.ts rename to src/ts/app/BlogPost.ts diff --git a/src/ts/BlogUrl.ts b/src/ts/app/BlogUrl.ts similarity index 100% rename from src/ts/BlogUrl.ts rename to src/ts/app/BlogUrl.ts diff --git a/src/ts/Input.ts b/src/ts/app/Input.ts similarity index 100% rename from src/ts/Input.ts rename to src/ts/app/Input.ts diff --git a/src/ts/TimeUtility.ts b/src/ts/app/TimeUtility.ts similarity index 100% rename from src/ts/TimeUtility.ts rename to src/ts/app/TimeUtility.ts diff --git a/src/ts/UI.ts b/src/ts/app/UI.ts similarity index 100% rename from src/ts/UI.ts rename to src/ts/app/UI.ts diff --git a/src/ts/app.ts b/src/ts/app/app.ts similarity index 100% rename from src/ts/app.ts rename to src/ts/app/app.ts