如何从 GitHub 源构建 leaflet.markercluster.js?
How to build leaflet.markercluster.js from GitHub source?
我想从 GitHub project 构建 leaflet.markercluster 的已编译 javascript 代码。我是编程新手,只想了解这是如何完成的。我的理解是 package.json 可以 运行 使用 grunt.js,但我看到 GitHub 来源中没有 gruntfile.js。
我使用 bower install leaflet.markercluster
下载了该项目,该项目显示在我位于 bower_components/
的本地项目文件夹中
bower_components/leaflet.markercluster/
中的package.json
是
{
"name": "leaflet.markercluster",
"version": "0.4.0",
"description": "Provides Beautiful Animated Marker Clustering functionality for Leaflet",
"dependencies": {
"leaflet": "~0.7.1"
},
"devDependencies": {
"jshint": "~2.1.3",
"mocha": "~1.10.0",
"karma": "~0.8.5",
"uglify-js": "~2.3.6",
"jake": "~0.5.16"
},
"main": "dist/leaflet.markercluster.js",
"scripts": {
"test": "jake test",
"prepublish": "jake"
},
"keywords": ["gis", "map"]
}
我将如何 运行 package.json
构建 dist/leaflet.markercluster.js?
package.json
用于 npm(节点包管理器,作为 Chris 添加的标签),不特定于 Grunt。
您可以按照以下步骤操作:
1) 安装 Node.js (自从您使用 Bower 以来可能已经完成).
2) 安装 Git (自从您使用 Bower 以来可能已经完成).
3) Clone 存储库到您的本地驱动器:git clone <git endpoint>
(在您的情况下 Leaflet.markercluster:git clone https://github.com/Leaflet/Leaflet.markercluster.git
)。 也许bower install
是等价的.
4) 导航到本地驱动器上新创建的 Leaflet.markercluster
文件夹。
5) 运行 npm install
。新建编译和缩小的 JS 文件应该出现在 "dist" 子文件夹中。请注意,为此您仍然需要 Internet 连接,因为 npm 将在 运行 此命令时下载所有依赖项和开发依赖项。
我想从 GitHub project 构建 leaflet.markercluster 的已编译 javascript 代码。我是编程新手,只想了解这是如何完成的。我的理解是 package.json 可以 运行 使用 grunt.js,但我看到 GitHub 来源中没有 gruntfile.js。
我使用 bower install leaflet.markercluster
下载了该项目,该项目显示在我位于 bower_components/
的本地项目文件夹中
bower_components/leaflet.markercluster/
中的package.json
是
{
"name": "leaflet.markercluster",
"version": "0.4.0",
"description": "Provides Beautiful Animated Marker Clustering functionality for Leaflet",
"dependencies": {
"leaflet": "~0.7.1"
},
"devDependencies": {
"jshint": "~2.1.3",
"mocha": "~1.10.0",
"karma": "~0.8.5",
"uglify-js": "~2.3.6",
"jake": "~0.5.16"
},
"main": "dist/leaflet.markercluster.js",
"scripts": {
"test": "jake test",
"prepublish": "jake"
},
"keywords": ["gis", "map"]
}
我将如何 运行 package.json
构建 dist/leaflet.markercluster.js?
package.json
用于 npm(节点包管理器,作为 Chris 添加的标签),不特定于 Grunt。
您可以按照以下步骤操作:
1) 安装 Node.js (自从您使用 Bower 以来可能已经完成).
2) 安装 Git (自从您使用 Bower 以来可能已经完成).
3) Clone 存储库到您的本地驱动器:git clone <git endpoint>
(在您的情况下 Leaflet.markercluster:git clone https://github.com/Leaflet/Leaflet.markercluster.git
)。 也许bower install
是等价的.
4) 导航到本地驱动器上新创建的 Leaflet.markercluster
文件夹。
5) 运行 npm install
。新建编译和缩小的 JS 文件应该出现在 "dist" 子文件夹中。请注意,为此您仍然需要 Internet 连接,因为 npm 将在 运行 此命令时下载所有依赖项和开发依赖项。