I want to add scrollto plugin to my Meteor project
I created package.js like in this tutorial: enter link description here
I don't know what I'm doing wrong.
I want to add scrollto plugin to my Meteor project
I created package.js like in this tutorial: enter link description here
I don't know what I'm doing wrong.
You don't have to create package for that. It's enough if you put the plugin file inside /client/lib/
directory. Please not that in order for your plugin to work, the jquery
built-in package must be added to your application, but it should be already there by default.
However, if you really want to create a package for that (sometimes it's useful) you will need to put the plugin source code (e.g. jquery.scrollTo.js
) along with the package.js
file in a separated subdirectory inside packages/
in your project root. Directory structure should look like this:
.meteor/
client/
packages/
jquery-scrollto/
package.js
jquery.scrollTo.js
and the source of package.js
:
Package.describe({
summary: "A jquery.scrollTo plugin",
version: "1.2.3", // best to use the version of plugin
name: "jquery-scrollto",
});
Package.onUse(function (api) {
api.versionsFrom("METEOR@1.0");
api.use('jquery', 'client');
api.addFiles('jquery.scrollTo.js', 'client');
});
Finally add your package name - so jquery-scrollto
- to the list in .meteor/packages
file.