忽略Meteor JS项目目录中的文件 [英] Ignoring files in a Meteor JS project directory

查看:104
本文介绍了忽略Meteor JS项目目录中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于JavaScript的库,我想将其包含在Meteor JS应用程序中。库源代码托管在Git仓库中,我希望将回购作为子模块包含在我自己的Meteor应用程序的源代码仓库中。但是,我不需要Meteor处理的大部分文件,只有少数选择的文件。事实上,流星barfs的错误:无法解析..恩......一些HTML文件,在某些行上,很遗憾,当它看到子模块中的许多文件时。

有没有办法选择将白名单或黑名单文件纳入项目目录中的Meteor应用程序?除了创建智能软件包之外,是否还有其他方法可以将我的Meteor应用程序项目目录中的外部资源(如Git子模块)包含进来。



更新:如相关解释如何创建软件包的问题,如果您创建智能软件包到Meteor本地的Git checkout中,您将获得包中代码的热重载行为。 另外,到jonathan提到的 / public 目录,Meteor也会忽略任何以。开头的目录。 - 所以你可以创建一个 .submodules 目录,并将文件放在那里,Meteor不会加载它们。

这可能比将它们放在 / public 中更可取,因为它们不是公开的。 p>

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.

解决方案

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.

这篇关于忽略Meteor JS项目目录中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆