2021-10-06 20:34:16 +02:00
|
|
|
const injectWebManifest = require("./scripts/build-plugins/manifest");
|
|
|
|
const injectServiceWorker = require("./scripts/build-plugins/service-worker");
|
2021-10-07 15:09:16 +02:00
|
|
|
const fs = require("fs");
|
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
const version = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8")).version;
|
2021-10-06 20:34:16 +02:00
|
|
|
|
2021-10-05 17:10:17 +02:00
|
|
|
export default {
|
|
|
|
public: false,
|
|
|
|
root: "src/platform/web",
|
|
|
|
server: {
|
|
|
|
hmr: false
|
2021-10-05 17:51:10 +02:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"safe-buffer": "./scripts/package-overrides/safe-buffer/index.js",
|
|
|
|
"buffer": "./scripts/package-overrides/buffer/index.js"
|
|
|
|
}
|
2021-10-05 19:29:00 +02:00
|
|
|
},
|
|
|
|
build: {
|
|
|
|
outDir: "../../../target",
|
2021-10-06 20:34:16 +02:00
|
|
|
emptyOutDir: true,
|
|
|
|
minify: true,
|
|
|
|
sourcemap: true
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
injectWebManifest("assets/manifest.json"),
|
|
|
|
injectServiceWorker("sw.js")
|
2021-10-07 15:09:16 +02:00
|
|
|
],
|
|
|
|
define: {
|
|
|
|
"HYDROGEN_VERSION": JSON.stringify(version)
|
|
|
|
}
|
2021-10-05 17:10:17 +02:00
|
|
|
};
|