mirror of https://github.com/lukechilds/rollup.git
Rich-Harris
9 years ago
3 changed files with 45 additions and 15 deletions
@ -0,0 +1,24 @@ |
|||||
|
var Promise = require( 'es6-promise' ).Promise; |
||||
|
|
||||
|
module.exports = { |
||||
|
description: 'transformers can be asynchronous', |
||||
|
options: { |
||||
|
plugins: [ |
||||
|
{ |
||||
|
transform: function ( code ) { |
||||
|
return Promise.resolve( code.replace( 'x', 1 ) ); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
transform: function ( code ) { |
||||
|
return code.replace( '1', 2 ); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
transform: function ( code ) { |
||||
|
return Promise.resolve( code.replace( '2', 3 ) ); |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
}; |
@ -0,0 +1 @@ |
|||||
|
assert.equal( x, 3 ); |
Loading…
Reference in new issue