|
@@ -65,30 +65,6 @@ let sourceMapRes = Object.values(watched).reduce((res, name) => {
|
|
|
return res;
|
|
|
}, []);
|
|
|
|
|
|
-/**
|
|
|
- * Sync a local path to a linked package path if they are files and differ.
|
|
|
- */
|
|
|
-function maybeSync(localPath, name, rest) {
|
|
|
- const stats = fs.statSync(localPath);
|
|
|
- if (!stats.isFile(localPath)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- const source = fs.realpathSync(plib.join(jlab.linkedPackages[name], rest));
|
|
|
- if (source === fs.realpathSync(localPath)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- fs.watchFile(source, { interval: 500 }, function(curr) {
|
|
|
- if (!curr || curr.nlink === 0) {
|
|
|
- return;
|
|
|
- }
|
|
|
- try {
|
|
|
- fs.copySync(source, localPath);
|
|
|
- } catch (err) {
|
|
|
- console.error(err);
|
|
|
- }
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* A filter function set up to exclude all files that are not
|
|
|
* in a package contained by the Jupyterlab repo. Used to ignore
|
|
@@ -112,7 +88,6 @@ function ignored(path) {
|
|
|
const rest = path.slice(rootPath.length);
|
|
|
if (rest.indexOf('node_modules') === -1) {
|
|
|
ignore = false;
|
|
|
- maybeSync(path, name, rest);
|
|
|
}
|
|
|
return true;
|
|
|
});
|
|
@@ -274,7 +249,8 @@ module.exports = [
|
|
|
]
|
|
|
},
|
|
|
watchOptions: {
|
|
|
- poll: 333
|
|
|
+ poll: 500,
|
|
|
+ aggregateTimeout: 1000
|
|
|
},
|
|
|
node: {
|
|
|
fs: 'empty'
|