Frontend Node version support (#382)

This commit is contained in:
sua yoo 2022-11-23 09:05:02 -08:00 committed by GitHub
parent 003b3c7a78
commit 3ad47a4c8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -98,5 +98,8 @@
"no-unused-vars": "warn" "no-unused-vars": "warn"
} }
}, },
"prettier": {} "prettier": {},
"engines": {
"node": ">=16 <20"
}
} }

View File

@ -58,8 +58,8 @@ const version = (() => {
} }
try { try {
return fs.readFileSync("../version.txt", {encoding: "utf-8"}).trim(); return fs.readFileSync("../version.txt", { encoding: "utf-8" }).trim();
} catch(e) {} } catch (e) {}
return packageJSON.version; return packageJSON.version;
})(); })();
@ -70,6 +70,9 @@ module.exports = {
path: path.resolve(__dirname, "dist"), path: path.resolve(__dirname, "dist"),
filename: `js/[name]${isDevServer ? "" : ".[contenthash]"}.js`, filename: `js/[name]${isDevServer ? "" : ".[contenthash]"}.js`,
publicPath: "/", publicPath: "/",
// Fix node >v16 compatibility issues
// https://stackoverflow.com/a/73465262
hashFunction: "xxhash64",
}, },
devtool: "inline-source-map", devtool: "inline-source-map",