mirror of https://github.com/lukechilds/rollup.git
Rich-Harris
9 years ago
3 changed files with 21 additions and 21 deletions
@ -1,18 +1,17 @@ |
|||||
var assert = require( 'assert' ); |
var assert = require( 'assert' ); |
||||
|
|
||||
|
var warned; |
||||
|
|
||||
module.exports = { |
module.exports = { |
||||
description: 'resolves pathological cyclical dependencies gracefully', |
description: 'resolves pathological cyclical dependencies gracefully', |
||||
babel: true, |
babel: true, |
||||
exports: function ( exports ) { |
options: { |
||||
assert.ok( exports.a.isA ); |
onwarn: function ( message ) { |
||||
assert.ok( exports.b1.isA ); |
assert.ok( /Module .+B\.js may be unable to evaluate without .+A\.js, but is included first due to a cyclical dependency. Consider swapping the import statements in .+main\.js to ensure correct ordering/.test( message ) ); |
||||
assert.ok( exports.b1.isB ); |
warned = true; |
||||
assert.ok( exports.b2.isA ); |
} |
||||
assert.ok( exports.b2.isB ); |
}, |
||||
assert.ok( exports.c1.isC ); |
runtimeError: function () { |
||||
assert.ok( exports.c1.isD ); |
assert.ok( warned ); |
||||
assert.ok( exports.c2.isC ); |
|
||||
assert.ok( exports.c2.isD ); |
|
||||
assert.ok( exports.d.isD ); |
|
||||
} |
} |
||||
}; |
}; |
||||
|
@ -1,15 +1,16 @@ |
|||||
var assert = require( 'assert' ); |
var assert = require( 'assert' ); |
||||
|
|
||||
|
var warned; |
||||
|
|
||||
module.exports = { |
module.exports = { |
||||
description: 'does not treat references inside IIFEs as weak dependencies', // edge case encountered in THREE.js codebase
|
description: 'does not treat references inside IIFEs as weak dependencies', // edge case encountered in THREE.js codebase
|
||||
exports: function ( exports ) { |
options: { |
||||
assert.ok( exports.a1.isA ); |
onwarn: function ( message ) { |
||||
assert.ok( exports.b1.isB ); |
assert.ok( /Module .+D\.js may be unable to evaluate without .+C\.js, but is included first due to a cyclical dependency. Consider swapping the import statements in .+main\.js to ensure correct ordering/.test( message ) ); |
||||
assert.ok( exports.c1.isC ); |
warned = true; |
||||
assert.ok( exports.d1.isD ); |
} |
||||
assert.ok( exports.a2.isA ); |
}, |
||||
assert.ok( exports.b2.isB ); |
runtimeError: function () { |
||||
assert.ok( exports.c2.isC ); |
assert.ok( warned ); |
||||
assert.ok( exports.d2.isD ); |
|
||||
} |
} |
||||
}; |
}; |
||||
|
Loading…
Reference in new issue