Skip to content

Instantly share code, notes, and snippets.

@rishi-raj-jain
Created January 23, 2022 11:38
Show Gist options
  • Save rishi-raj-jain/c018977441dd499cf4b6f2b04d9773d2 to your computer and use it in GitHub Desktop.
Save rishi-raj-jain/c018977441dd499cf4b6f2b04d9773d2 to your computer and use it in GitHub Desktop.
const { build } = require("esbuild")
build({
entryPoints: ["./path/to/service-worker.js"],
outfile: "./dist/service-worker.js",
minify: true,
bundle: true,
define: {
'process.env.NODE_ENV': '"production"',
'process.env.SOME_VARIABLE': '"SOME_VALUE"'
},
}).catch(() => process.exit(1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment