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.

25 lines
574 B

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 );
}
};