Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
886 views
in Technique[技术] by (71.8m points)

git - Ignoring files in a Meteor JS project directory

I have a JavaScript based library I'd like to include in a Meteor JS application. The library source code is hosted in a Git repository and I'd like to include the repo as a submodule in my own source code repo for my Meteor app. However, I don't need a majority of the files included processed by Meteor, only a few select ones. Indeed Meteor barfs with "Error: Couldn't parse .. um .. some HTML file, on some line. sorry" when it sees many of the files in the submodule.

Is there a way to selectively whitelist or blacklist files for inclusion into the Meteor app inside the project directory? Apart from creating a Smart Package, are there ways in which I could include external resources such as Git submodules inside my Meteor app project directory.

Update: as explained in the related question of "How to create a package", if you create a Smart Package into a local Git checkout of Meteor itself, you get the hot-reload behaviour for the code in the package.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In addition to the /public directory that jonathan mentions, Meteor also ignores any directories that begin with a "." - so you could create a .submodules directory and put the files in there and Meteor won't load them.

This is probably preferable to having them in /public since, well, they're not public.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...