Remove explicit JavaScript to simplify build

This commit is contained in:
Florine W. Dekker 2021-09-02 01:06:42 +02:00
parent c174d5a647
commit 14d1f1bb6f
Signed by: FWDekker
GPG Key ID: 78B3EAF58145AF25
5 changed files with 14 additions and 58 deletions

View File

@ -13,12 +13,12 @@ module.exports = grunt => {
},
focus: {
dev: {
include: ["html", "js"],
include: ["html"],
},
},
replace: {
dev: {
src: ["./dist/*.html", "./dist/*.js"],
src: ["./dist/*.html"],
replacements: [
{
from: "%%VERSION_NUMBER%%",
@ -28,7 +28,7 @@ module.exports = grunt => {
overwrite: true
},
deploy: {
src: ["./dist/*.html", "./dist/*.js"],
src: ["./dist/*.html"],
replacements: [
{
from: "%%VERSION_NUMBER%%",
@ -43,37 +43,6 @@ module.exports = grunt => {
files: ["src/main/**/*.html"],
tasks: ["copy:html", "replace:dev"],
},
js: {
files: ["src/main/**/*.js"],
tasks: ["webpack:dev", "replace:dev"],
},
},
webpack: {
options: {
entry: "./src/main/js/main.js",
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
},
],
},
resolve: {
extensions: [".js"],
},
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist/"),
},
},
dev: {
mode: "development",
devtool: "inline-source-map",
},
deploy: {
mode: "production",
},
},
});
@ -82,15 +51,13 @@ module.exports = grunt => {
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-focus");
grunt.loadNpmTasks("grunt-text-replace");
grunt.loadNpmTasks("grunt-webpack");
grunt.registerTask("dev", [
// Pre
"clean",
// Copy files
"copy:html",
// Compile TS
"webpack:dev",
// Insert version number
"replace:dev",
]);
grunt.registerTask("dev:server", ["dev", "focus:dev"]);
@ -99,8 +66,7 @@ module.exports = grunt => {
"clean",
// Copy files
"copy:html",
// Compile TS
"webpack:deploy",
// Insert version number
"replace:deploy",
]);

BIN
package-lock.json generated

Binary file not shown.

View File

@ -1,6 +1,6 @@
{
"name": "about",
"version": "1.3.0",
"version": "1.3.1",
"description": "All about F.W. Dekker",
"author": "F.W. Dekker",
"browser": "dist/bundle.js",
@ -22,9 +22,6 @@
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-focus": "^1.0.0",
"grunt-text-replace": "^0.4.0",
"grunt-webpack": "^4.0.3",
"webpack": "^5.51.1",
"webpack-cli": "^4.8.0"
"grunt-text-replace": "^0.4.0"
}
}

View File

@ -8,6 +8,12 @@
<meta name="description" content="All about F.W. Dekker." />
<meta name="theme-color" content="#0033cc" />
<meta name="fwd:nav:target" content="#nav" />
<meta name="fwd:nav:highlight-path" content="/About/" />
<meta name="fwd:footer:target" content="#footer" />
<meta name="fwd:footer:vcs-url" content="https://git.fwdekker.com/FWDekker/about/" />
<meta name="fwd:footer:version" content="v%%VERSION_NUMBER%%" />
<title>About | FWDekker</title>
<link rel="stylesheet" href="https://static.fwdekker.com/fonts/roboto/roboto.css" />
@ -74,7 +80,7 @@
My PGP key is hosted in the web key directory on this domain, but your email client will
probably find it for you automatically.
If it doesn't, use GPG's <samp>--locate-key</samp> function or grab the key directly from the
personalia.
personalia section on this page.
</p>
</div>
<div class="column column-25">
@ -116,7 +122,5 @@
</main>
<script src="https://static.fwdekker.com/lib/template/2.x.x/template.js"></script>
<!--suppress HtmlUnknownTarget -->
<script src="bundle.js?v=%%VERSION_NUMBER%%"></script>
</body>
</html>

View File

@ -1,11 +0,0 @@
// noinspection JSUnresolvedVariable
const {$, doAfterLoad, footer, nav} = window.fwdekker;
doAfterLoad(() => {
$("#nav").appendChild(nav("/About/"));
$("#footer").appendChild(footer({
vcsURL: "https://git.fwdekker.com/FWDekker/about/",
version: "v%%VERSION_NUMBER%%"
}));
});