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.
20 lines
397 B
20 lines
397 B
9 years ago
|
var fs = require( 'fs' );
|
||
|
|
||
|
module.exports = {
|
||
|
description: 'uses custom loaders, falling back to default',
|
||
|
options: {
|
||
|
load: [
|
||
|
function ( id ) {
|
||
|
if ( /foo\.js/.test( id ) ) {
|
||
|
return fs.readFileSync( id, 'utf-8' ).replace( '@', 1 );
|
||
|
}
|
||
|
},
|
||
|
function ( id ) {
|
||
|
if ( /bar\.js/.test( id ) ) {
|
||
|
return fs.readFileSync( id, 'utf-8' ).replace( '@', 2 );
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
};
|