feat: POW miner

This commit is contained in:
2023-08-18 00:35:48 +01:00
parent 667518a2df
commit 2a851c442d
14 changed files with 209 additions and 40 deletions

View File

@ -17,6 +17,10 @@ const config = {
import: "./src/service-worker.ts",
filename: "service-worker.js",
},
pow: {
import: require.resolve("@snort/system/dist/pow-worker.js"),
filename: "pow.js",
},
},
target: "browserslist",
mode: isProduction ? "production" : "development",
@ -24,12 +28,7 @@ const config = {
output: {
publicPath: "/",
path: path.resolve(__dirname, "build"),
filename: ({ runtime }) => {
if (runtime === "sw") {
return "[name].js";
}
return isProduction ? "[name].[chunkhash].js" : "[name].js";
},
filename: isProduction ? "[name].[chunkhash].js" : "[name].js",
clean: isProduction,
},
devServer: {
@ -50,7 +49,7 @@ const config = {
new HtmlWebpackPlugin({
template: "public/index.html",
favicon: "public/favicon.ico",
excludeChunks: ["sw"],
excludeChunks: ["sw", "pow"],
}),
new ESLintPlugin({
extensions: ["js", "mjs", "jsx", "ts", "tsx"],