mirror of https://github.com/lukechilds/rollup.git
operandom
9 years ago
4 changed files with 43 additions and 0 deletions
@ -0,0 +1,4 @@ |
|||
module.exports = { |
|||
description: 'external option gets passed from config', |
|||
command: 'rollup -c -e assert,external-module' |
|||
}; |
@ -0,0 +1,8 @@ |
|||
'use strict'; |
|||
|
|||
var ___config_js = require('./_config.js'); |
|||
var assert = require('assert'); |
|||
var externalModule = require('external-module'); |
|||
|
|||
assert.ok( ___config_js.execute ); |
|||
externalModule.method(); |
@ -0,0 +1,6 @@ |
|||
import { execute } from './_config.js'; |
|||
import { ok } from 'assert'; |
|||
import { method } from 'external-module'; |
|||
|
|||
ok( execute ); |
|||
method(); |
@ -0,0 +1,25 @@ |
|||
import assert from 'assert'; |
|||
import { resolve, sep } from 'path'; |
|||
|
|||
var config = resolve( './_config.js' ).split(sep).join('/'); |
|||
|
|||
export default { |
|||
entry: 'main.js', |
|||
format: 'cjs', |
|||
|
|||
external: function (id) { |
|||
if (id === config) { |
|||
return true; |
|||
} |
|||
|
|||
return false; |
|||
}, |
|||
|
|||
plugins: [ |
|||
{ |
|||
load: function ( id ) { |
|||
assert.notEqual( id, config ); |
|||
} |
|||
} |
|||
] |
|||
}; |
Loading…
Reference in new issue