mirror of https://github.com/lukechilds/rollup.git
Rich-Harris
9 years ago
24 changed files with 153 additions and 2 deletions
@ -0,0 +1,6 @@ |
|||
module.exports = { |
|||
description: 'external paths (#754)', |
|||
options: { |
|||
paths: id => `https://npmcdn.com/${id}` |
|||
} |
|||
}; |
@ -0,0 +1,7 @@ |
|||
define(['https://npmcdn.com/foo'], function (foo) { 'use strict'; |
|||
|
|||
foo = 'default' in foo ? foo['default'] : foo; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
}); |
@ -0,0 +1,7 @@ |
|||
'use strict'; |
|||
|
|||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } |
|||
|
|||
var foo = _interopDefault(require('https://npmcdn.com/foo')); |
|||
|
|||
assert.equal( foo, 42 ); |
@ -0,0 +1,3 @@ |
|||
import foo from 'https://npmcdn.com/foo'; |
|||
|
|||
assert.equal( foo, 42 ); |
@ -0,0 +1,8 @@ |
|||
(function (foo) { |
|||
'use strict'; |
|||
|
|||
foo = 'default' in foo ? foo['default'] : foo; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
}(foo)); |
@ -0,0 +1,11 @@ |
|||
(function (global, factory) { |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('https://npmcdn.com/foo')) : |
|||
typeof define === 'function' && define.amd ? define(['https://npmcdn.com/foo'], factory) : |
|||
(factory(global.foo)); |
|||
}(this, function (foo) { 'use strict'; |
|||
|
|||
foo = 'default' in foo ? foo['default'] : foo; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
})); |
@ -0,0 +1,3 @@ |
|||
import foo from 'foo'; |
|||
|
|||
assert.equal( foo, 42 ); |
@ -0,0 +1,13 @@ |
|||
const { resolve } = require( 'path' ); |
|||
|
|||
const resolved = resolve( __dirname, 'foo.js' ); |
|||
|
|||
module.exports = { |
|||
description: 'external paths (#754)', |
|||
options: { |
|||
external: [ resolved ], |
|||
paths: { |
|||
[ resolved ]: '../foo' |
|||
} |
|||
} |
|||
}; |
@ -0,0 +1,7 @@ |
|||
define(['../foo'], function (foo) { 'use strict'; |
|||
|
|||
foo = 'default' in foo ? foo['default'] : foo; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
}); |
@ -0,0 +1,7 @@ |
|||
'use strict'; |
|||
|
|||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } |
|||
|
|||
var foo = _interopDefault(require('../foo')); |
|||
|
|||
assert.equal( foo, 42 ); |
@ -0,0 +1,3 @@ |
|||
import foo from '../foo'; |
|||
|
|||
assert.equal( foo, 42 ); |
@ -0,0 +1,8 @@ |
|||
(function (foo) { |
|||
'use strict'; |
|||
|
|||
foo = 'default' in foo ? foo['default'] : foo; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
}(foo)); |
@ -0,0 +1,11 @@ |
|||
(function (global, factory) { |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../foo')) : |
|||
typeof define === 'function' && define.amd ? define(['../foo'], factory) : |
|||
(factory(global.foo)); |
|||
}(this, function (foo) { 'use strict'; |
|||
|
|||
foo = 'default' in foo ? foo['default'] : foo; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
})); |
@ -0,0 +1,3 @@ |
|||
import foo from './foo.js'; |
|||
|
|||
assert.equal( foo, 42 ); |
@ -0,0 +1,8 @@ |
|||
module.exports = { |
|||
description: 'external paths (#754)', |
|||
options: { |
|||
paths: { |
|||
foo: 'https://npmcdn.com/foo' |
|||
} |
|||
} |
|||
}; |
@ -0,0 +1,7 @@ |
|||
define(['https://npmcdn.com/foo'], function (foo) { 'use strict'; |
|||
|
|||
foo = 'default' in foo ? foo['default'] : foo; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
}); |
@ -0,0 +1,7 @@ |
|||
'use strict'; |
|||
|
|||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } |
|||
|
|||
var foo = _interopDefault(require('https://npmcdn.com/foo')); |
|||
|
|||
assert.equal( foo, 42 ); |
@ -0,0 +1,3 @@ |
|||
import foo from 'https://npmcdn.com/foo'; |
|||
|
|||
assert.equal( foo, 42 ); |
@ -0,0 +1,8 @@ |
|||
(function (foo) { |
|||
'use strict'; |
|||
|
|||
foo = 'default' in foo ? foo['default'] : foo; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
}(foo)); |
@ -0,0 +1,11 @@ |
|||
(function (global, factory) { |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('https://npmcdn.com/foo')) : |
|||
typeof define === 'function' && define.amd ? define(['https://npmcdn.com/foo'], factory) : |
|||
(factory(global.foo)); |
|||
}(this, function (foo) { 'use strict'; |
|||
|
|||
foo = 'default' in foo ? foo['default'] : foo; |
|||
|
|||
assert.equal( foo, 42 ); |
|||
|
|||
})); |
@ -0,0 +1,3 @@ |
|||
import foo from 'foo'; |
|||
|
|||
assert.equal( foo, 42 ); |
Loading…
Reference in new issue