UNPKG

577 BJavaScriptView Raw
1const { installSnapshotArtefacts } = require("../snapshot/android/project-snapshot-generator");
2const { shouldSnapshot } = require("./utils");
3
4module.exports = function (hookArgs) {
5 const env = hookArgs.env || {};
6 env.hmr = hookArgs.appFilesUpdaterOptions.useHotModuleReload;
7 const shouldSnapshotOptions = {
8 platform: hookArgs.platform,
9 bundle: hookArgs.appFilesUpdaterOptions.bundle,
10 release: hookArgs.appFilesUpdaterOptions.release
11 };
12
13 if (env.snapshot && shouldSnapshot(shouldSnapshotOptions)) {
14 installSnapshotArtefacts(hookArgs.projectData.projectDir);
15 }
16}