-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from esperantojs/resolution
Resolution
- Loading branch information
Showing
21 changed files
with
307 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var path = require( 'path' ); | ||
var Promise = require( 'sander' ).Promise; | ||
var resolve = require( 'resolve' ); | ||
|
||
module.exports = { | ||
description: 'External module paths can be resolved with resolvePath option', | ||
resolvePath: function ( importee, importer ) { | ||
return new Promise( function ( fulfil, reject ) { | ||
var callback = function ( err, result ) { | ||
if ( err ) { | ||
reject( err ); | ||
} else { | ||
fulfil( result ); | ||
} | ||
}; | ||
|
||
resolve( importee, { | ||
basedir: path.dirname( importer ), | ||
moduleDirectory: 'js_modules', // to avoid faffing with .gitignore | ||
packageFilter: function ( pkg ) { | ||
if ( pkg[ 'jsnext:main' ] ) { | ||
pkg.main = pkg[ 'jsnext:main' ]; | ||
} | ||
|
||
return pkg; | ||
} | ||
}, callback ); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function a () { | ||
console.log( 'I am module a' ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function c () { | ||
console.log( 'I am module c' ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import a from 'a'; | ||
import b from 'b'; | ||
|
||
export default function external () { | ||
console.log( 'I am an external dependency' ); | ||
a(); | ||
b(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import c from 'c'; | ||
|
||
export default function b () { | ||
console.log( 'I am module b' ); | ||
c(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "external", | ||
"version": "0.1.0", | ||
"main": "dist/external.js", | ||
"jsnext:main": "src/external.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import a from 'a'; | ||
import b from 'b'; | ||
|
||
export default function external () { | ||
console.log( 'I am an external dependency' ); | ||
a(); | ||
b(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import external from 'external'; | ||
|
||
external(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
define(function () { | ||
|
||
'use strict'; | ||
|
||
function a () { | ||
console.log( 'I am module a' ); | ||
} | ||
|
||
function c () { | ||
console.log( 'I am module c' ); | ||
} | ||
|
||
function b () { | ||
console.log( 'I am module b' ); | ||
c(); | ||
} | ||
|
||
function external () { | ||
console.log( 'I am an external dependency' ); | ||
a(); | ||
b(); | ||
} | ||
|
||
external(); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
define(function () { | ||
|
||
'use strict'; | ||
|
||
function a () { | ||
console.log( 'I am module a' ); | ||
} | ||
|
||
function c () { | ||
console.log( 'I am module c' ); | ||
} | ||
|
||
function b () { | ||
console.log( 'I am module b' ); | ||
c(); | ||
} | ||
|
||
function external () { | ||
console.log( 'I am an external dependency' ); | ||
a(); | ||
b(); | ||
} | ||
|
||
external(); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
function a () { | ||
console.log( 'I am module a' ); | ||
} | ||
|
||
function c () { | ||
console.log( 'I am module c' ); | ||
} | ||
|
||
function b () { | ||
console.log( 'I am module b' ); | ||
c(); | ||
} | ||
|
||
function external () { | ||
console.log( 'I am an external dependency' ); | ||
a(); | ||
b(); | ||
} | ||
|
||
external(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
function a () { | ||
console.log( 'I am module a' ); | ||
} | ||
|
||
function c () { | ||
console.log( 'I am module c' ); | ||
} | ||
|
||
function b () { | ||
console.log( 'I am module b' ); | ||
c(); | ||
} | ||
|
||
function external () { | ||
console.log( 'I am an external dependency' ); | ||
a(); | ||
b(); | ||
} | ||
|
||
external(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(function () { 'use strict'; | ||
|
||
function a () { | ||
console.log( 'I am module a' ); | ||
} | ||
|
||
function c () { | ||
console.log( 'I am module c' ); | ||
} | ||
|
||
function b () { | ||
console.log( 'I am module b' ); | ||
c(); | ||
} | ||
|
||
function external () { | ||
console.log( 'I am an external dependency' ); | ||
a(); | ||
b(); | ||
} | ||
|
||
external(); | ||
|
||
})(); |
Oops, something went wrong.