mirror of https://github.com/lukechilds/rollup.git
Arpad Borsos
10 years ago
4 changed files with 23 additions and 1 deletions
@ -0,0 +1,15 @@ |
|||||
|
module.exports = { |
||||
|
description: 'imports external module for side effects', |
||||
|
context: { |
||||
|
// override require here, making "foo" appear as a global module
|
||||
|
require: function ( name ) { |
||||
|
if ( name === 'foo' ) { |
||||
|
return require( './foo' ); |
||||
|
} |
||||
|
return require( name ); |
||||
|
} |
||||
|
}, |
||||
|
options: { |
||||
|
external: [ 'foo' ] |
||||
|
} |
||||
|
}; |
@ -0,0 +1 @@ |
|||||
|
global.answer = 42; |
@ -0,0 +1,3 @@ |
|||||
|
import 'foo'; |
||||
|
|
||||
|
assert.equal( global.answer, 42 ); |
Loading…
Reference in new issue