mirror of https://github.com/lukechilds/rollup.git
Rich Harris
8 years ago
committed by
GitHub
7 changed files with 44 additions and 0 deletions
@ -0,0 +1,37 @@ |
|||
const path = require( 'path' ); |
|||
const assert = require( 'assert' ); |
|||
|
|||
module.exports = { |
|||
description: 'bundle.modules includes dependencies (#903)', |
|||
bundle ( bundle ) { |
|||
const modules = bundle.modules.map( module => { |
|||
return { |
|||
id: path.relative( __dirname, module.id ), |
|||
dependencies: module.dependencies.map( id => path.relative( __dirname, id ) ) |
|||
}; |
|||
}); |
|||
|
|||
assert.deepEqual( modules, [ |
|||
{ |
|||
id: path.normalize( 'nested/qux.js' ), |
|||
dependencies: [] |
|||
}, |
|||
{ |
|||
id: path.normalize( 'nested/baz.js' ), |
|||
dependencies: [ path.normalize( 'nested/qux.js' ) ] |
|||
}, |
|||
{ |
|||
id: 'bar.js', |
|||
dependencies: [ path.normalize( 'nested/baz.js' ) ] |
|||
}, |
|||
{ |
|||
id: 'foo.js', |
|||
dependencies: [ 'bar.js' ] |
|||
}, |
|||
{ |
|||
id: 'main.js', |
|||
dependencies: [ 'foo.js', 'bar.js' ] |
|||
} |
|||
]); |
|||
} |
|||
}; |
@ -0,0 +1 @@ |
|||
import './nested/baz.js'; |
@ -0,0 +1 @@ |
|||
import './bar.js'; |
@ -0,0 +1,2 @@ |
|||
import './foo.js'; |
|||
import './bar.js'; |
@ -0,0 +1 @@ |
|||
import qux from './qux.js'; |
@ -0,0 +1 @@ |
|||
export default 'whatever'; |
Loading…
Reference in new issue