Compare commits
No commits in common. "003f32b6a4b5f143d4e2e79bea1f6b5238261a55" and "40144c1dd6bed4559f1f815e522b3ec6fae6da3d" have entirely different histories.
003f32b6a4
...
40144c1dd6
5 changed files with 5 additions and 1580 deletions
78
gulpfile.ts
78
gulpfile.ts
|
@ -1,11 +1,7 @@
|
||||||
import browserSync, { BrowserSyncInstance } from "browser-sync";
|
import GulpClient from "gulp";
|
||||||
import GulpClient, { TaskFunction } from "gulp";
|
|
||||||
import path from "upath";
|
|
||||||
import { Context } from "./gulp/Context.js";
|
import { Context } from "./gulp/Context.js";
|
||||||
|
|
||||||
const { dest, parallel, series, src, watch } = GulpClient;
|
const { dest, parallel, src } = GulpClient;
|
||||||
const { join } = path;
|
|
||||||
|
|
||||||
const context = new Context();
|
const context = new Context();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -84,73 +80,3 @@ export function Build(): Promise<void>
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Reloads all browsers using `browser-sync`.
|
|
||||||
*
|
|
||||||
* @param syncer
|
|
||||||
* The browser-sync instance to work on.
|
|
||||||
*
|
|
||||||
* @param filePath
|
|
||||||
* A glob-path which points to the files which must be reloaded.
|
|
||||||
*
|
|
||||||
* @returns
|
|
||||||
* The actual task.
|
|
||||||
*/
|
|
||||||
function BrowserSync(syncer: BrowserSyncInstance, filePath?: string): TaskFunction
|
|
||||||
{
|
|
||||||
let BrowserSync: TaskFunction = (done) =>
|
|
||||||
{
|
|
||||||
if (filePath)
|
|
||||||
{
|
|
||||||
syncer.reload(filePath);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
syncer.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
done();
|
|
||||||
};
|
|
||||||
|
|
||||||
return BrowserSync;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Builds and watches the files for changes.
|
|
||||||
*/
|
|
||||||
export function Watch(): void
|
|
||||||
{
|
|
||||||
let syncer = browserSync.create();
|
|
||||||
Build();
|
|
||||||
|
|
||||||
syncer.init({
|
|
||||||
open: false,
|
|
||||||
server: context.StaticPath(),
|
|
||||||
online: false
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(
|
|
||||||
context.SourcePath(context.JSDirName),
|
|
||||||
series(
|
|
||||||
JavaScript,
|
|
||||||
BrowserSync(syncer, "*.js")));
|
|
||||||
|
|
||||||
watch(
|
|
||||||
context.SourcePath(context.StyleDirName, "**", "*.css"),
|
|
||||||
series(
|
|
||||||
Styles,
|
|
||||||
BrowserSync(syncer, "*.css")));
|
|
||||||
|
|
||||||
watch(
|
|
||||||
context.SourcePath(context.AssetDirName),
|
|
||||||
series(
|
|
||||||
Assets,
|
|
||||||
BrowserSync(syncer, join(context.AssetDirName, "**", "*"))));
|
|
||||||
|
|
||||||
watch(
|
|
||||||
context.SourcePath("**", "*.html"),
|
|
||||||
series(
|
|
||||||
WebPages,
|
|
||||||
BrowserSync(syncer, "*.html")));
|
|
||||||
}
|
|
||||||
|
|
1492
package-lock.json
generated
1492
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -12,10 +12,8 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@manuth/eslint-plugin-typescript": "^4.0.0",
|
"@manuth/eslint-plugin-typescript": "^4.0.0",
|
||||||
"@manuth/tsconfig": "^3.0.2",
|
"@manuth/tsconfig": "^3.0.2",
|
||||||
"@types/browser-sync": "^2.26.3",
|
|
||||||
"@types/gulp": "^4.0.10",
|
"@types/gulp": "^4.0.10",
|
||||||
"@types/node": "^18.11.10",
|
"@types/node": "^18.11.10",
|
||||||
"browser-sync": "^2.27.10",
|
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^8.23.1",
|
"eslint": "^8.23.1",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<title>Connect Four</title>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="stylesheet" type="text/css" href="./styles/style.css">
|
|
||||||
<script src="./js/main.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Welcome to ConnectForce</h1>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in a new issue