mirror of https://github.com/lukechilds/rollup.git
17 lines
467 B
17 lines
467 B
var fs = require( 'fs' );
|
|
var path = require( 'path' );
|
|
|
|
module.exports = {
|
|
description: 'exports an anonymous function with custom ID resolver', // yeah, this is a real edge case
|
|
options: {
|
|
plugins: [{
|
|
resolveId: function ( importee, importer ) {
|
|
return path.basename( importee ).replace( /\..+/, '' );
|
|
},
|
|
load: function ( id ) {
|
|
console.log( 'id', id )
|
|
return fs.readFileSync( path.join( __dirname, id + '.js' ), 'utf-8' );
|
|
}
|
|
}]
|
|
}
|
|
};
|
|
|