mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 08:18:50 +00:00
My big initial commit to this repo and project.
This commit is contained in:
parent
750811a81f
commit
8636f8cf9b
2433 changed files with 199488 additions and 1042 deletions
29
node_modules/meteor-node-stubs/scripts/build-deps.js
generated
vendored
Normal file
29
node_modules/meteor-node-stubs/scripts/build-deps.js
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var depsDir = path.join(__dirname, "..", "deps");
|
||||
var map = require("../map.json");
|
||||
|
||||
// Each file in the `deps` directory expresses the dependencies of a stub.
|
||||
// For example, `deps/http.js` calls `require("http-browserify")` to
|
||||
// indicate that the `http` stub depends on the `http-browserify` package.
|
||||
// This makes it easy for a bundling tool like Browserify, Webpack, or
|
||||
// Meteor to include the appropriate package dependencies by depending on
|
||||
// `meteor-node-stubs/deps/http` rather than having to know how the `http`
|
||||
// stub is implemented. Some modules in the `deps` directory are empty,
|
||||
// such as `deps/fs.js`, which indicates that no dependencies need to be
|
||||
// bundled. Note that these modules should not be `require`d at runtime,
|
||||
// but merely scanned at bundling time.
|
||||
|
||||
fs.mkdir(depsDir, function () {
|
||||
require("rimraf")("deps/*.js", function (error) {
|
||||
if (error) throw error;
|
||||
Object.keys(map).forEach(function (id) {
|
||||
fs.writeFileSync(
|
||||
path.join(depsDir, id + ".js"),
|
||||
typeof map[id] === "string"
|
||||
? "require(" + JSON.stringify(map[id]) + ");\n"
|
||||
: ""
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue