Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register to npm #37

Open
twolfson opened this issue Jan 22, 2015 · 2 comments
Open

Register to npm #37

twolfson opened this issue Jan 22, 2015 · 2 comments

Comments

@twolfson
Copy link

This package is close to being installable via npm. The package.json has more/less all the data it needs. It is missing a main which points to src: 'src/jquery.autosave.js'. Additionally, the documentation needs to indicate that a window.jQuery must be available before requiring the module.

For those interested in using this package before this gets closed, you can install the package via a git url:

"jquery-autosave": "git://github.com/nervetattoo/jquery-autosave.git#6ac81411"

Then, the source can be loaded via:

window.jquery = require('jquery');
require('jquery-autosave/src/jquery.autosave.js');
window.jquery('form').autosave; // autosave is now loaded
@thorne51
Copy link

thorne51 commented Sep 23, 2016

main which points to src: 'src/jquery.autosave.js'

Any reason you would point the main property to the source file and not dist/jquery.autosave.min.js? I've done this in my fork in order to use with browserify on my Laravel project.

Also, I used npm install thorne51/jquery-autosave --save (seeing as npm resolves GitHub repository names now) to import to my project. This results in only the minified file being added together with the package.json and readme.md files (guessing this is due to the files property in the package.json). Would hence make more sense to make the main file the minified file instead of the source.

@twolfson
Copy link
Author

I use src over dist so any stack traces involving jquery.autosave.js will give me info from its expanded form

I use the git:// version so I can point to a fixed version of the repo instead of master which might be volatile and break my build unexpectedly (i.e. username/repo is similar to using * for npm dependencies)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants