How to prevent Meteor from watching files?

后端 未结 2 1051
抹茶落季
抹茶落季 2020-12-18 20:58

I would like to use Dojo Toolkit with Meteor.

  1. I first copy the whole Dojo Toolkit tree in /public

  2. Then, I include it on the cli

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-18 21:45

    This is a big issue for large scale applications built in Meteor. I talked to Matt over at Meteor, and he said that their team is working on a solution to this problem for one of their upcoming releases. So get on their newsletter, and you'll be notified when it is available.

    Mathieu, your comment:

    I finally found a workaround. I'm putting everything in /public/lib/. Then, line 286 of /usr/lib/meteor/app/run.js, I'm adding the folder I don't want Meteor to watch: self.exclude_paths = [ path.join(app_dir, '.meteor', 'local'), path.join(app_dir, 'public', 'lib') ]; This way I can have as much files as I want in lib, and they don't slow everything down. include path is '/lib/dojo/dojo.js'.

    is a good hack for now, and here are the other issues that relate that will also be covered in the upcoming release:

    • Some packages have overlapping dependencies, but do not exclude them like in PHP's require_once().

    • A native require / define dynamic script loader, so not all files are loaded on entry one that can calculate dependency order without having to go levels, lib or main.*

    • An official way to create and deploy packages to a repository. Currently it is using Meteorite (mrt) and Atmosphere.

提交回复
热议问题