mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"install": {
|
||||
"version": "0.4.2"
|
||||
"version": "0.4.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ Package.describe({
|
||||
});
|
||||
|
||||
Npm.depends({
|
||||
install: "0.4.2"
|
||||
install: "0.4.4"
|
||||
});
|
||||
|
||||
Package.onUse(function(api) {
|
||||
|
||||
@@ -495,14 +495,30 @@ _.extend(File.prototype, {
|
||||
_getClosureHeader() {
|
||||
if (this._useMeteorInstall()) {
|
||||
var header = "";
|
||||
|
||||
if (this.deps.length > 0) {
|
||||
header += "[";
|
||||
_.each(this.deps, dep => {
|
||||
header += JSON.stringify(dep) + ",";
|
||||
});
|
||||
}
|
||||
return header + "function(require,exports,module){";
|
||||
|
||||
const headerParts = [
|
||||
header,
|
||||
"function(require,exports,module"
|
||||
];
|
||||
|
||||
if (this.source.match(/\b__dirname\b/)) {
|
||||
headerParts.push(",__filename,__dirname");
|
||||
} else if (this.source.match(/\b__filename\b/)) {
|
||||
headerParts.push(",__filename");
|
||||
}
|
||||
|
||||
headerParts.push("){");
|
||||
|
||||
return headerParts.join("");
|
||||
}
|
||||
|
||||
return "(function(){";
|
||||
},
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"dependencies": {
|
||||
"events": "^1.1.0",
|
||||
"moment": "2.11.1",
|
||||
"path": "^0.12.7",
|
||||
"regenerator": "^0.8.42",
|
||||
"stream-browserify": "^2.0.1",
|
||||
"util": "^0.10.3"
|
||||
|
||||
@@ -90,6 +90,14 @@ describe("app modules", () => {
|
||||
let foo = 1234;
|
||||
delete foo;
|
||||
});
|
||||
|
||||
it("should have access to filename and dirname", () => {
|
||||
assert.strictEqual(require(__filename), exports);
|
||||
assert.strictEqual(
|
||||
require("path").relative(__dirname, __filename),
|
||||
"tests.js"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("template modules", () => {
|
||||
|
||||
Reference in New Issue
Block a user