Question

In my meteor project I want to use gulp for tasks meteor doesn't support. Anyway, the problem is that gulp uses a file called gulpfile.js which is loaded by meteor too and gives errors. So my question is, is there a way to tell meteor to ignore some files ?

UPDATE: One solution I can think of is to put gulpfile.js in the folder packages or public and run gulp as follows

$> gulp --gulpfile packages/gulpfile.js

UPDATE: Just noticed that meteor also seems to load node_modules files :(

Était-ce utile?

La solution

Unfortunately, in the current release there's no way to tell Meteor to leave certain files alone, so you cannot have gulpfile.js in your main app folder.

You can, however, leave it in an ignored subfolder. Meteor ignores files and directories that ends with tilde ~, the /tests directory and all private files (those beginning with a dot .). So you can create a folder named for example gulp~ and use it for your gulp-related stuff.

 


 

The same holds for node_modules folder, you cannot have it in your application, and you shouldn't. If you want to use a node package in your Meteor application, you can do this with npm package.

  • Add it to your project with mrt add npm command.

  • Then create packages.json file with a list of all required packages, for example:

    {
      "something":       "1.5.0",
      "something-else":  "0.9.11"
    }
    
  • Afterwards, include your package with Meteor.require:

    var something = Meteor.require('something');

If you want to use a node package in your gulp tasks, install it inside the ignored directory.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top