mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Although the Meteor jquery package is no long a core package (and thus is not tied to the Meteor release), it seems like a good idea to nudge folks towards installing jquery from npm, instead of relying on the very old version (1.12.1) residing in meteor/packages/non-core/jquery/jquery.js. Closes #10289.
28 lines
874 B
JavaScript
28 lines
874 B
JavaScript
try {
|
|
var jQuery = require("jquery");
|
|
} catch (e) {
|
|
console.warn([
|
|
"The jquery npm package could not be found in your node_modules directory.",
|
|
"Please run the following command to install it:",
|
|
"",
|
|
" meteor npm install jquery",
|
|
"",
|
|
"If you previously relied on a specific version of jquery, it may be important",
|
|
"to install that version; for example:",
|
|
"",
|
|
" meteor npm install jquery@1.12.1",
|
|
"",
|
|
].join("\n"));
|
|
}
|
|
|
|
if (jQuery) {
|
|
// Provide values for the exported variables of the jquery package.
|
|
exports.$ = exports.jQuery = jQuery;
|
|
|
|
// There's no stopping legacy code from referring to window.$ or
|
|
// window.jQuery, so we have to keep defining those properties globally,
|
|
// but at least the exports of this package will be reliable.
|
|
global.$ = global.$ || jQuery;
|
|
global.jQuery = global.jQuery || jQuery;
|
|
}
|