mirror of https://github.com/lukechilds/rollup.git
Rich Harris
9 years ago
17 changed files with 173 additions and 6 deletions
@ -0,0 +1,4 @@ |
|||
module.exports = { |
|||
description: 'generates IIFE export with all code', |
|||
command: 'rollup main.js --format iife --name shakeless --no-treeshake' |
|||
}; |
@ -0,0 +1,10 @@ |
|||
var shakeless = (function () { |
|||
'use strict'; |
|||
|
|||
const version = '1.2.0'; |
|||
|
|||
var main = ( x, y ) => x + y; |
|||
|
|||
return main; |
|||
|
|||
}()); |
@ -0,0 +1,3 @@ |
|||
const version = '1.2.0'; |
|||
|
|||
export default ( x, y ) => x + y; |
@ -0,0 +1,11 @@ |
|||
module.exports = { |
|||
description: 'all code should be included if tree-shaking is disabled', |
|||
options: { |
|||
external: [ 'external' ], |
|||
globals: { |
|||
external: 'external' |
|||
}, |
|||
moduleName: /* not shaken, but */ 'stirred', |
|||
treeshake: false |
|||
} |
|||
}; |
@ -0,0 +1,20 @@ |
|||
define(['exports', 'external'], function (exports, external) { 'use strict'; |
|||
|
|||
var foo = 'unused'; |
|||
|
|||
const quux = 1; |
|||
|
|||
const other = () => quux; |
|||
|
|||
function bar () { |
|||
return foo; |
|||
} |
|||
|
|||
function baz () { |
|||
return 13 + external.value; |
|||
} |
|||
|
|||
exports.baz = baz; |
|||
exports.strange = quux; |
|||
|
|||
}); |
@ -0,0 +1,20 @@ |
|||
'use strict'; |
|||
|
|||
var external = require('external'); |
|||
|
|||
var foo = 'unused'; |
|||
|
|||
const quux = 1; |
|||
|
|||
const other = () => quux; |
|||
|
|||
function bar () { |
|||
return foo; |
|||
} |
|||
|
|||
function baz () { |
|||
return 13 + external.value; |
|||
} |
|||
|
|||
exports.baz = baz; |
|||
exports.strange = quux; |
@ -0,0 +1,17 @@ |
|||
import * as external from 'external'; |
|||
|
|||
var foo = 'unused'; |
|||
|
|||
const quux = 1; |
|||
|
|||
const other = () => quux; |
|||
|
|||
function bar () { |
|||
return foo; |
|||
} |
|||
|
|||
function baz () { |
|||
return 13 + external.value; |
|||
} |
|||
|
|||
export { baz, quux as strange }; |
@ -0,0 +1,21 @@ |
|||
(function (exports,external) { |
|||
'use strict'; |
|||
|
|||
var foo = 'unused'; |
|||
|
|||
const quux = 1; |
|||
|
|||
const other = () => quux; |
|||
|
|||
function bar () { |
|||
return foo; |
|||
} |
|||
|
|||
function baz () { |
|||
return 13 + external.value; |
|||
} |
|||
|
|||
exports.baz = baz; |
|||
exports.strange = quux; |
|||
|
|||
}((this.stirred = this.stirred || {}),external)); |
@ -0,0 +1,24 @@ |
|||
(function (global, factory) { |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external')) : |
|||
typeof define === 'function' && define.amd ? define(['exports', 'external'], factory) : |
|||
(factory((global.stirred = global.stirred || {}),global.external)); |
|||
}(this, function (exports,external) { 'use strict'; |
|||
|
|||
var foo = 'unused'; |
|||
|
|||
const quux = 1; |
|||
|
|||
const other = () => quux; |
|||
|
|||
function bar () { |
|||
return foo; |
|||
} |
|||
|
|||
function baz () { |
|||
return 13 + external.value; |
|||
} |
|||
|
|||
exports.baz = baz; |
|||
exports.strange = quux; |
|||
|
|||
})); |
@ -0,0 +1 @@ |
|||
export default 'unused'; |
@ -0,0 +1,11 @@ |
|||
import * as external from 'external'; |
|||
import foo from './foo.js' |
|||
export { quux as strange } from './quux.js'; |
|||
|
|||
function bar () { |
|||
return foo; |
|||
} |
|||
|
|||
export function baz () { |
|||
return 13 + external.value; |
|||
} |
@ -0,0 +1,3 @@ |
|||
export const quux = 1; |
|||
|
|||
const other = () => quux; |
Loading…
Reference in new issue