Hi all,
I am a new user (some weeks) of Meteor.
I try to write a Meteor package for my application. This package is expected to use jQuery, but I’m unable to make it works
package.js:
Package.describe({
name: 'pwi:ronin-core-prefs',
version: '1.0.0',
summary: 'User prefences management',
git: '',
documentation: 'README.md'
});
Package.onUse( function( api ){
configure( api );
api.mainModule( 'ronin-core-prefs.js' );
});
Package.onTest( function( api ){
configure( api );
api.use('tinytest');
api.mainModule( 'ronin-core-prefs-tests.js' );
});
function configure( api ){
api.versionsFrom( '1.8.1' );
api.use( 'ecmascript' );
api.use( 'jquery' );
api.use( 'pwi:ronin-core-ui' );
}
ronin-core-prefs.js
import { Ronin } from 'meteor/pwi:ronin-core';
Ronin.prefs = {};
import './lib/user_prefs.js';
user_prefs.js
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { Ronin } from 'meteor/pwi:ronin-core';
//<nothing> // ReferenceError: $ is not defined
//import 'jquery'; // ReferenceError: $ is not defined
//import 'meteor/jquery'; // ReferenceError: $ is not defined
//import { $ } from 'meteor/jquery'; // TypeError: Cannot read property 'extend' of undefined
//import { jQuery as $ } from 'meteor/jquery'; // TypeError: Cannot read property 'extend' of undefined
I expected that declaring “api.use( ‘jquery’ );” would be enough, but it is not the case.
And I don’t understand how importing jQuery into my user_prefs.js script.
Could someone be kind enough to give some help or hint or pointer ?
Thanks in advance.
Regards
Barbaps