Permalink
Browse files

Use full library for JSON modules and runtime dependency for static m…

…odules, fixes #621
  • Loading branch information...
dcodeIO committed Jan 5, 2017
1 parent 8ec2579 commit c9a61e574f5a2b06f6b15b14c0c0ff56f8381d1f
Showing with 5 additions and 4 deletions.
  1. +1 −1 cli/targets/static-module.js
  2. +1 −0 cli/util.js
  3. +1 −1 cli/wrappers/commonjs.js
  4. +1 −1 cli/wrappers/default.js
  5. +1 −1 package.json
@@ -19,7 +19,7 @@ function static_module_target(root, options, callback) {
if (err)
return callback(err);
try {
output = util.wrap(output, options);
output = util.wrap(output, protobuf.util.merge({ dependency: "protobufjs/runtime" }, options));
} catch (e) {
callback(e);
return;
@@ -110,6 +110,7 @@ exports.wrap = function(OUTPUT, options) {
wrap = fs.readFileSync(path.resolve(process.cwd(), name)).toString("utf8");
}
wrap = wrap.replace(/%ROOT%/g, JSON.stringify(options.root || "default"));
wrap = wrap.replace(/%DEPENDENCY%/g, JSON.stringify(options.dependency || "protobufjs"));
wrap = wrap.replace(/( *)%OUTPUT%/, function($0, $1) {
return $1.length ? OUTPUT.replace(/^/mg, $1) : OUTPUT;
});
@@ -1,6 +1,6 @@
"use strict";
var $protobuf = require("protobufjs/runtime");
var $protobuf = require(%DEPENDENCY%);
%OUTPUT%
@@ -4,7 +4,7 @@
define(["protobuf"], factory);
/* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
module.exports = factory(require("protobufjs/runtime"));
module.exports = factory(require(%DEPENDENCY%));
})(this, function($protobuf) {
"use strict";
@@ -86,7 +86,7 @@
"vinyl-buffer": "^1.0.0",
"vinyl-fs": "^2.4.4",
"vinyl-source-stream": "^1.1.0",
"zuul": "^3.11.1",
"zuul": "dcodeIO/zuul",
"zuul-ngrok": "^4.0.0"
},
"cliDependencies": [

0 comments on commit c9a61e5

Please sign in to comment.