]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/bundle.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / fstream-npm / example / bundle.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/bundle.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/bundle.js
new file mode 100644 (file)
index 0000000..159e4f7
--- /dev/null
@@ -0,0 +1,13 @@
+// this example will bundle every dependency
+var P = require("../")
+P({ path: "./" })
+  .on("package", bundleIt)
+  .on("entry", function (e) {
+    console.error(e.constructor.name, e.path.substr(e.root.dirname.length + 1))
+    e.on("package", bundleIt)
+  })
+
+function bundleIt (p) {
+  p.bundleDependencies = Object.keys(p.dependencies || {})
+}
+