Permalink
Browse files

Revert "Add shim support for module internal files, update todos"

This reverts commit 8af73bb.
  • Loading branch information...
1 parent 4ad2c26 commit 146073289adedcebe37029a502f332b88734fbd1 @mixu committed Jun 4, 2014
Showing with 3 additions and 35 deletions.
  1. +1 −3 index.js
  2. +0 −6 lib/list/detective.js
  3. +0 −8 lib/require/require.js
  4. +1 −1 lib/require/require.min.js
  5. +1 −2 test/package.json
  6. +0 −15 todo.md
View
@@ -69,9 +69,7 @@ API.prototype.render = function(dest) {
list.basepath(this.options['basepath']);
}
- var includes = this.options['include'];
-
- (Array.isArray(includes) ? includes : [ includes ]).map(function(filepath) {
+ this.options['include'].map(function(filepath) {
list.add(filepath);
});
@@ -121,12 +121,6 @@ DetectiveList.prototype.resolveErrors = function() {
return this._resolveErrors;
};
-var oldAdd = DetectiveList.prototype.add;
-DetectiveList.prototype.add = function() {
- console.log('add', Array.prototype.slice.apply(arguments));
- oldAdd.apply(this, Array.prototype.slice.apply(arguments));
-};
-
var oldExec = DetectiveList.prototype.exec;
DetectiveList.prototype.exec = function() {
this._resolveErrors = [];
@@ -32,14 +32,6 @@ var r = (function() {
if(!mod) {
throw new Error('failed to require "' + path + '" from ' + context);
}
- } else {
- // module internal file
- var ifile = p && p.split('/');
- if(ifile.length > 1 && r.m[context][ifile[0]]) {
- context = r.m[context][ifile[0]].c;
- path = r.resolve(ifile.slice(1).join('/'), context);
- mod = r.m[context][path];
- }
}
if (!mod) {
// the initial load failed, or the previous require failed
@@ -1 +1 @@
-var r=function(){var e="function"==typeof require&&require,r=function(n,o,u){o||(o=0);var i=r.resolve(n,o),t=r.m[o][i];if(!t&&e){if(t=e(i))return t}else if(t&&t.c){if(o=t.c,i=t.m,t=r.m[o][t.m],!t)throw new Error('failed to require "'+i+'" from '+o)}else{var f=n&&n.split("/");f.length>1&&r.m[o][f[0]]&&(o=r.m[o][f[0]].c,i=r.resolve(f.slice(1).join("/"),o),t=r.m[o][i])}if(!t)throw new Error('failed to require "'+n+'" from '+u);return t.exports||(t.exports={},t.call(t.exports,t,t.exports,r.relative(i,o))),t.exports};return r.resolve=function(e,i){var n=e,t=e+".js",o=e+"/index.js";return r.m[i][t]&&t?t:r.m[i][o]&&o?o:n},r.relative=function(e,t){return function(i){if("."!=i.charAt(0))return r(i,t,e);var o=e.split("/"),u=i.split("/");o.pop();for(var n=0;n<u.length;n++){var f=u[n];".."==f?o.pop():"."!=f&&o.push(f)}return r(o.join("/"),t,e)}},r}();
+var r=function(){var e="function"==typeof require&&require,r=function(i,o,u){o||(o=0);var n=r.resolve(i,o),t=r.m[o][n];if(!t&&e){if(t=e(n))return t}else if(t&&t.c&&(o=t.c,n=t.m,t=r.m[o][t.m],!t))throw new Error('failed to require "'+n+'" from '+o);if(!t)throw new Error('failed to require "'+i+'" from '+u);return t.exports||(t.exports={},t.call(t.exports,t,t.exports,r.relative(n,o))),t.exports};return r.resolve=function(e,n){var i=e,t=e+".js",o=e+"/index.js";return r.m[n][t]&&t?t:r.m[n][o]&&o?o:i},r.relative=function(e,t){return function(n){if("."!=n.charAt(0))return r(n,t,e);var o=e.split("/"),f=n.split("/");o.pop();for(var i=0;i<f.length;i++){var u=f[i];".."==u?o.pop():"."!=u&&o.push(u)}return r(o.join("/"),t,e)}},r}();
View
@@ -9,7 +9,6 @@
"es6-module-transpiler": "~0.3.1",
"handlebars-runtime": "~1.0.12",
"hbsfy": "~0.1.5",
- "uglify-js": "~2.4.8",
- "express": "~3.5.0"
+ "uglify-js": "~2.4.8"
}
}
View
@@ -10,19 +10,6 @@ gluejs v2.next adds optional dependency parsing support:
# Todo
-- Parse:
- - add support for parsing directory --include arguments
- - disable the automatic excludes like `/dist/` because they mess with things like jquery
- - transform and command options: parse the resulting file for dependencies
- - direct file requires like `require('jade/runtime')` should resolve correctly
-
-
-// calculate a hash for the full list of files
-// this can be used to validate etags
-// it is based on the paths, mtimes and sizes of all files (sorted)
-// plus the current set of options passed through a MD5 hash
-// if it matches, just return the cached resource
-
- add `cache clean`
- improve the autodetection code so that people don't need to supply a --main argument in default cases (e.g. when there is a index.js or there is just one file in the package)
@@ -53,8 +40,6 @@ Benefits
Test cases:
-- browser field in package.json remaps a file to a differently named file
-- browser field in package.json remaps a module to a file
- exclude unused file like package.json
- include unmentioned file
- include unmentioned module

0 comments on commit 1460732

Please sign in to comment.