mirror of https://github.com/lukechilds/rollup.git
1111hui
8 years ago
13 changed files with 74 additions and 34 deletions
@ -1,6 +1,7 @@ |
|||
module.exports = { |
|||
description: 'supports environments without Object.freeze', |
|||
description: 'supports environments without Object.freeze, Object.defined', |
|||
options: { |
|||
moduleName: 'myBundle', |
|||
legacy: true |
|||
} |
|||
}; |
|||
|
@ -1,13 +1,20 @@ |
|||
define(function () { 'use strict'; |
|||
define(['exports'], function (exports) { 'use strict'; |
|||
|
|||
const foo = 42; |
|||
const foo = 1; |
|||
const bar = 2; |
|||
|
|||
|
|||
var namespace = (Object.freeze || Object)({ |
|||
foo: foo |
|||
foo: foo, |
|||
bar: bar |
|||
}); |
|||
|
|||
const x = 'foo'; |
|||
assert.equal( namespace[x], 42 ); |
|||
console.log( Object.keys( namespace ) ); |
|||
|
|||
const a = 1; |
|||
const b = 2; |
|||
|
|||
exports.a = a; |
|||
exports.b = b; |
|||
|
|||
}); |
|||
|
@ -1,11 +1,18 @@ |
|||
'use strict'; |
|||
|
|||
const foo = 42; |
|||
const foo = 1; |
|||
const bar = 2; |
|||
|
|||
|
|||
var namespace = (Object.freeze || Object)({ |
|||
foo: foo |
|||
foo: foo, |
|||
bar: bar |
|||
}); |
|||
|
|||
const x = 'foo'; |
|||
assert.equal( namespace[x], 42 ); |
|||
console.log( Object.keys( namespace ) ); |
|||
|
|||
const a = 1; |
|||
const b = 2; |
|||
|
|||
exports.a = a; |
|||
exports.b = b; |
|||
|
@ -1,9 +1,15 @@ |
|||
const foo = 42; |
|||
const foo = 1; |
|||
const bar = 2; |
|||
|
|||
|
|||
var namespace = (Object.freeze || Object)({ |
|||
foo: foo |
|||
foo: foo, |
|||
bar: bar |
|||
}); |
|||
|
|||
const x = 'foo'; |
|||
assert.equal( namespace[x], 42 ); |
|||
console.log( Object.keys( namespace ) ); |
|||
|
|||
const a = 1; |
|||
const b = 2; |
|||
|
|||
export { a, b }; |
|||
|
@ -1,14 +1,21 @@ |
|||
(function () { |
|||
(function (exports) { |
|||
'use strict'; |
|||
|
|||
const foo = 42; |
|||
const foo = 1; |
|||
const bar = 2; |
|||
|
|||
|
|||
var namespace = (Object.freeze || Object)({ |
|||
foo: foo |
|||
foo: foo, |
|||
bar: bar |
|||
}); |
|||
|
|||
const x = 'foo'; |
|||
assert.equal( namespace[x], 42 ); |
|||
console.log( Object.keys( namespace ) ); |
|||
|
|||
}()); |
|||
const a = 1; |
|||
const b = 2; |
|||
|
|||
exports.a = a; |
|||
exports.b = b; |
|||
|
|||
}((this.myBundle = this.myBundle || {}))); |
|||
|
@ -1,17 +1,24 @@ |
|||
(function (global, factory) { |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory() : |
|||
typeof define === 'function' && define.amd ? define(factory) : |
|||
(factory()); |
|||
}(this, (function () { 'use strict'; |
|||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : |
|||
typeof define === 'function' && define.amd ? define(['exports'], factory) : |
|||
(factory((global.myBundle = global.myBundle || {}))); |
|||
}(this, (function (exports) { 'use strict'; |
|||
|
|||
const foo = 42; |
|||
const foo = 1; |
|||
const bar = 2; |
|||
|
|||
|
|||
var namespace = (Object.freeze || Object)({ |
|||
foo: foo |
|||
foo: foo, |
|||
bar: bar |
|||
}); |
|||
|
|||
const x = 'foo'; |
|||
assert.equal( namespace[x], 42 ); |
|||
console.log( Object.keys( namespace ) ); |
|||
|
|||
const a = 1; |
|||
const b = 2; |
|||
|
|||
exports.a = a; |
|||
exports.b = b; |
|||
|
|||
}))); |
|||
|
@ -1,4 +1,6 @@ |
|||
import * as namespace from './namespace.js'; |
|||
|
|||
const x = 'foo'; |
|||
assert.equal( namespace[x], 42 ); |
|||
console.log( Object.keys( namespace ) ); |
|||
|
|||
export const a = 1; |
|||
export const b = 2; |
|||
|
@ -1 +1,2 @@ |
|||
export const foo = 42; |
|||
export const foo = 1; |
|||
export const bar = 2; |
|||
|
Loading…
Reference in new issue