[Pkg-javascript-commits] [node-module-deps] 79/444: noParse implementation for jquery, threejs etc

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:45 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-module-deps.

commit 79f2167922c3653a896bba65fa67d5174f1ebc20
Author: James Halliday <mail at substack.net>
Date:   Fri May 17 11:30:13 2013 -0700

    noParse implementation for jquery, threejs etc
---
 index.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index bdde8a2..7c51902 100644
--- a/index.js
+++ b/index.js
@@ -9,6 +9,8 @@ var through = require('through');
 var concatStream = require('concat-stream');
 
 module.exports = function (mains, opts) {
+    if (!opts) opts = {};
+    
     if (!Array.isArray(mains)) mains = [ mains ].filter(Boolean);
     mains = mains.map(function (file) {
         return path.resolve(file);
@@ -20,9 +22,7 @@ module.exports = function (mains, opts) {
     
     var output = through();
     
-    if (!opts) opts = {};
     var transforms = [].concat(opts.transform).filter(Boolean);
-    
     var resolve = opts.resolve || browserResolve;
     
     var top = { id: '/', filename: '/', paths: [] };
@@ -100,7 +100,10 @@ module.exports = function (mains, opts) {
     
     function parseDeps (file, src) {
         var deps;
-        if (/\.json$/.test(file)) {
+        if (opts.noParse && opts.noParse.indexOf(file) >= 0) {
+            deps = [];
+        }
+        else if (/\.json$/.test(file)) {
             deps = [];
         }
         else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git



More information about the Pkg-javascript-commits mailing list