Skip to content

Commit

Permalink
Add the 404 page.
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronAsAChimp committed Dec 27, 2023
1 parent 7915ed5 commit d683e7f
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 1 deletion.
22 changes: 22 additions & 0 deletions docs/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>404</title>
<script type="module">
let url = window.location.pathname;

if (window.location.search) {
url += window.location.search;
}

if (window.location.hash) {
url += window.location.hash;
}

window.location = '/?url=' + encodeURIComponent(url);
</script>
</head>
<body></body>
</html>
1 change: 1 addition & 0 deletions image-lint-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"vue-router": "^4.2.5"
},
"devDependencies": {
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^3.4.1",
"eslint": "^8.24.0",
Expand Down
12 changes: 11 additions & 1 deletion image-lint-web/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
import CopyPlugin from 'copy-webpack-plugin';
import {VueLoaderPlugin} from 'vue-loader';
// import packageJson from '../image-lint/package.json';
import {fileURLToPath} from 'url';
Expand All @@ -14,12 +15,13 @@ const packageJson = JSON.parse(await readFile(fileURLToPath(import.meta.resolve(

const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const DOCS_DIR = path.resolve(__dirname, '../docs');

const config = {
entry: './web/js/index.js',
devtool: isProduction ? 'source-map' : 'eval',
output: {
path: path.resolve(__dirname, '../docs'),
path: DOCS_DIR,
filename: 'js/[name].[contenthash].js',
clean: true,
},
Expand Down Expand Up @@ -62,6 +64,14 @@ const config = {
__VUE_PROD_DEVTOOLS__: false,
}),
new VueLoaderPlugin(),
new CopyPlugin({
patterns: [
{
from: 'web/404.html',
to: DOCS_DIR,
},
],
}),
],
resolve: {
alias: {
Expand Down
114 changes: 114 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d683e7f

Please sign in to comment.