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.
26 lines
574 B
26 lines
574 B
9 years ago
|
var assert = require( 'assert' );
|
||
|
var MagicString = require( 'magic-string' );
|
||
|
|
||
|
module.exports = {
|
||
|
description: 'allows sourcemap chains with some untransformed modules (#404)',
|
||
|
options: {
|
||
|
plugins: [{
|
||
|
transform: function ( code, id ) {
|
||
|
if ( /untransformed-modules\/foo/.test( id ) ) {
|
||
|
var s = new MagicString( code );
|
||
|
var index = code.indexOf( '1' );
|
||
|
s.overwrite( index, index + 1, '2' );
|
||
|
|
||
|
return {
|
||
|
code: s.toString(),
|
||
|
map: s.generateMap({ hires: true })
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
}]
|
||
|
},
|
||
|
test: function () {
|
||
|
assert.ok( true );
|
||
|
}
|
||
|
};
|