mirror of https://github.com/lukechilds/rollup.git
4 changed files with 25 additions and 1 deletions
@ -0,0 +1,15 @@ |
|||||
|
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: { |
||||
|
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' ); |
||||
|
} |
||||
|
} |
||||
|
}; |
@ -0,0 +1 @@ |
|||||
|
export default 42; |
@ -0,0 +1,5 @@ |
|||||
|
import answer from './answer'; |
||||
|
|
||||
|
export default function () { |
||||
|
console.log( 'the answer is ' + answer ); |
||||
|
} |
Loading…
Reference in new issue