disable ASAR
Summary: Metro's new version using `jest-haste-map` wants to access files inside our ASAR bundle, not using electron's require function. This fails, because it can not read from inside the ASAR bundle. For this reason we are disabeling ASAR for now. Additionally, we are disabling reloads when a hidden file changes. This is because watchman creates a `.watchman-cookie` which shoudln't triggers a reload. But in general I think it's safe to not reload when hidden files are changed, as they are unlikely to have actual code in them. Reviewed By: passy Differential Revision: D10426715 fbshipit-source-id: 6ad9dcf88c62d5b65a9736eff28aadaf89c6af7a
This commit is contained in:
committed by
Facebook Github Bot
parent
f973bdd455
commit
6d18701d6a
@@ -19,7 +19,8 @@
|
|||||||
},
|
},
|
||||||
"win": {
|
"win": {
|
||||||
"publisherName": "Facebook, Inc."
|
"publisherName": "Facebook, Inc."
|
||||||
}
|
},
|
||||||
|
"asar": false
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"@jest-runner/electron/electron": "3.0.0"
|
"@jest-runner/electron/electron": "3.0.0"
|
||||||
|
|||||||
@@ -35,9 +35,13 @@ function watchChanges(plugins, reloadCallback, pluginCache) {
|
|||||||
|
|
||||||
Object.values(plugins).map(plugin =>
|
Object.values(plugins).map(plugin =>
|
||||||
fs.watch(plugin.rootDir, (eventType, filename) => {
|
fs.watch(plugin.rootDir, (eventType, filename) => {
|
||||||
|
// only recompile for changes in not hidden files. Watchman might create
|
||||||
|
// a file called .watchman-cookie
|
||||||
|
if (!filename.startsWith('.')) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(`🕵️ Detected changes in ${plugin.name}`);
|
console.log(`🕵️ Detected changes in ${plugin.name}`);
|
||||||
compilePlugin(plugin, true, pluginCache).then(reloadCallback);
|
compilePlugin(plugin, true, pluginCache).then(reloadCallback);
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user