mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Expose the "version" field of package.json files at runtime.
This commit is contained in:
@@ -449,6 +449,7 @@ export default class ImportScanner {
|
||||
// Output a JS module that exports just the "name" and "main"
|
||||
// properties defined in the package.json file.
|
||||
"exports.name = " + JSON.stringify(pkg.name) + ";\n" +
|
||||
"exports.version = " + JSON.stringify(pkg.version) + ";\n" +
|
||||
"exports.main = " + JSON.stringify(pkg.main) + ";\n"
|
||||
);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Test app exercising many aspects of the Meteor module system.",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"moment": "^2.11.1",
|
||||
"moment": "2.11.1",
|
||||
"regenerator": "^0.8.42"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -121,6 +121,11 @@ describe("local node_modules", () => {
|
||||
// Defined in packages/modules-test-package/common.js.
|
||||
assert.strictEqual(typeof regeneratorRuntime, "object");
|
||||
});
|
||||
|
||||
it('should expose "version" field of package.json', () => {
|
||||
const pkg = require("moment/package.json");
|
||||
assert.strictEqual(pkg.version, "2.11.1");
|
||||
});
|
||||
});
|
||||
|
||||
describe("Meteor packages", () => {
|
||||
|
||||
Reference in New Issue
Block a user