mirror of https://github.com/lukechilds/rollup.git
Rich Harris
10 years ago
7 changed files with 42 additions and 8 deletions
@ -1,6 +1,6 @@ |
|||
module.exports = { |
|||
description: 'prefixes global names with `global.` when creating UMD bundle (#57)', |
|||
options: { |
|||
external: [ 'factory' ] |
|||
external: [ 'factory', 'baz', 'alphabet' ] |
|||
} |
|||
}; |
|||
|
@ -1,5 +1,10 @@ |
|||
define(['factory'], function (factory) { 'use strict'; |
|||
define(['factory', 'baz', 'alphabet'], function (factory, baz, alphabet) { 'use strict'; |
|||
|
|||
var alphabet__default = 'default' in alphabet ? alphabet['default'] : alphabet; |
|||
|
|||
factory( null ); |
|||
baz.foo( baz.bar ); |
|||
console.log( alphabet.a ); |
|||
console.log( alphabet__default.length ); |
|||
|
|||
}); |
|||
|
@ -1 +1,8 @@ |
|||
import factory from 'factory'; |
|||
import { bar, foo } from 'baz'; |
|||
import alphabet, { a } from 'alphabet'; |
|||
|
|||
factory( null ); |
|||
foo( bar ); |
|||
console.log( a ); |
|||
console.log( alphabet.length ); |
|||
|
@ -1,5 +1,10 @@ |
|||
(function (factory) { 'use strict'; |
|||
(function (factory,baz,alphabet) { 'use strict'; |
|||
|
|||
var alphabet__default = 'default' in alphabet ? alphabet['default'] : alphabet; |
|||
|
|||
factory( null ); |
|||
baz.foo( baz.bar ); |
|||
console.log( alphabet.a ); |
|||
console.log( alphabet__default.length ); |
|||
|
|||
})(factory); |
|||
})(factory,baz,alphabet); |
|||
|
@ -1,9 +1,14 @@ |
|||
(function (global, factory) { |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('factory')) : |
|||
typeof define === 'function' && define.amd ? define(['factory'], factory) : |
|||
factory(global.factory); |
|||
}(this, function (factory) { 'use strict'; |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('factory'), require('baz'), require('alphabet')) : |
|||
typeof define === 'function' && define.amd ? define(['factory', 'baz', 'alphabet'], factory) : |
|||
factory(global.factory,global.baz,global.alphabet); |
|||
}(this, function (factory,baz,alphabet) { 'use strict'; |
|||
|
|||
var alphabet__default = 'default' in alphabet ? alphabet['default'] : alphabet; |
|||
|
|||
factory( null ); |
|||
baz.foo( baz.bar ); |
|||
console.log( alphabet.a ); |
|||
console.log( alphabet__default.length ); |
|||
|
|||
})); |
|||
|
@ -1,2 +1,8 @@ |
|||
import factory from 'factory'; |
|||
import { foo, bar } from 'baz'; |
|||
import alphabet, { a, b } from 'alphabet'; |
|||
|
|||
factory( null ); |
|||
foo( bar ); |
|||
console.log( a ); |
|||
console.log( alphabet.length ); |
|||
|
Loading…
Reference in new issue