mirror of https://github.com/lukechilds/rollup.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
517 B
22 lines
517 B
var assert = require( 'assert' );
|
|
|
|
module.exports = {
|
|
description: 'uses a custom path resolver (synchronous)',
|
|
options: {
|
|
resolvePath: function ( importee, importer ) {
|
|
var Promise = require( 'sander' ).Promise;
|
|
var resolved;
|
|
|
|
if ( importee === 'foo' ) {
|
|
resolved = require( 'path' ).resolve( __dirname, 'bar.js' );
|
|
} else {
|
|
resolved = false;
|
|
}
|
|
|
|
return Promise.resolve( resolved );
|
|
}
|
|
},
|
|
exports: function ( exports ) {
|
|
assert.strictEqual( exports.path, require( 'path' ) );
|
|
}
|
|
};
|
|
|