mirror of https://github.com/lukechilds/rollup.git
fatfisz
9 years ago
5 changed files with 29 additions and 0 deletions
@ -0,0 +1,22 @@ |
|||
var assert = require( 'assert' ); |
|||
var path = require( 'path' ); |
|||
|
|||
|
|||
module.exports = { |
|||
description: 'includes a relative external module only once (two external deps)', |
|||
options: { |
|||
external: [ |
|||
path.join( __dirname, './foo.js' ), |
|||
path.join( __dirname, './first/foo.js' ) |
|||
] |
|||
}, |
|||
context: { |
|||
require: function ( required ) { |
|||
assert( [ './foo.js', './first/foo.js' ].indexOf(required) !== -1, 'required wrong module' ); |
|||
return required === './foo.js' ? 'a' : 'b'; |
|||
} |
|||
}, |
|||
exports: function ( exports ) { |
|||
assert( exports === 'ab' || exports === 'ba', 'two different modules should be required' ); |
|||
} |
|||
}; |
@ -0,0 +1,3 @@ |
|||
import foo from './foo'; |
|||
|
|||
export default foo; |
@ -0,0 +1,4 @@ |
|||
import foo from './foo'; |
|||
import first from './first/module'; |
|||
|
|||
export default foo + first; |
Loading…
Reference in new issue