Packaging jQuery Plugins: Difference between revisions
Jump to navigation
Jump to search
| Line 13: | Line 13: | ||
See [[Marking Releases With Git]] | See [[Marking Releases With Git]] | ||
=== Specifying files to install with `npm` === | |||
Use the `.npmignore` file in the root of plugin project to specify which files to exclude when running `npm install`. `.npmignore` works the same way as `.gitignore`. <ref>[https://docs.npmjs.com/files/package.json#files `files` setting in `package.json` documentation], `npm` documentation</ref> | |||
=== Using plugins in projects === | === Using plugins in projects === | ||
Revision as of 17:43, 8 April 2016
Overview
Process for creating, maintaining, and distributing jQuery plugins using GitHub and npm.
Helper tools
- jQuery Boilerplate Boilerplate for creating jQuery plugins
Distribution
Marking a release
Specifying files to install with npm
Use the .npmignore file in the root of plugin project to specify which files to exclude when running npm install. .npmignore works the same way as .gitignore. [1]
Using plugins in projects
Use npm to fetch the plugin from GitHub, included in in the project, and add it to the project requirements:
$ npm install git+https://git@github.com/northrose/lightboxLink.git --save
- The
--saveparameter updatespackage.json, adding the package as a dependency of the project. - To use a branch other than
masterappend#branchnameto the repo URL.
- Using jQuery plugins with npm,
npmBlog - Publishing your jQuery plugin to npm, the quick and dirty way,
npmBlog
See also
Internal pages
References
<referemces />
- ↑
filessetting inpackage.jsondocumentation,npmdocumentation