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 = { |
module.exports = { |
||||
description: 'supports environments without Object.freeze', |
description: 'supports environments without Object.freeze, Object.defined', |
||||
options: { |
options: { |
||||
|
moduleName: 'myBundle', |
||||
legacy: true |
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)({ |
var namespace = (Object.freeze || Object)({ |
||||
foo: foo |
foo: foo, |
||||
|
bar: bar |
||||
}); |
}); |
||||
|
|
||||
const x = 'foo'; |
console.log( Object.keys( namespace ) ); |
||||
assert.equal( namespace[x], 42 ); |
|
||||
|
const a = 1; |
||||
|
const b = 2; |
||||
|
|
||||
|
exports.a = a; |
||||
|
exports.b = b; |
||||
|
|
||||
}); |
}); |
||||
|
@ -1,11 +1,18 @@ |
|||||
'use strict'; |
'use strict'; |
||||
|
|
||||
const foo = 42; |
const foo = 1; |
||||
|
const bar = 2; |
||||
|
|
||||
|
|
||||
var namespace = (Object.freeze || Object)({ |
var namespace = (Object.freeze || Object)({ |
||||
foo: foo |
foo: foo, |
||||
|
bar: bar |
||||
}); |
}); |
||||
|
|
||||
const x = 'foo'; |
console.log( Object.keys( namespace ) ); |
||||
assert.equal( namespace[x], 42 ); |
|
||||
|
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)({ |
var namespace = (Object.freeze || Object)({ |
||||
foo: foo |
foo: foo, |
||||
|
bar: bar |
||||
}); |
}); |
||||
|
|
||||
const x = 'foo'; |
console.log( Object.keys( namespace ) ); |
||||
assert.equal( namespace[x], 42 ); |
|
||||
|
const a = 1; |
||||
|
const b = 2; |
||||
|
|
||||
|
export { a, b }; |
||||
|
@ -1,14 +1,21 @@ |
|||||
(function () { |
(function (exports) { |
||||
'use strict'; |
'use strict'; |
||||
|
|
||||
const foo = 42; |
const foo = 1; |
||||
|
const bar = 2; |
||||
|
|
||||
|
|
||||
var namespace = (Object.freeze || Object)({ |
var namespace = (Object.freeze || Object)({ |
||||
foo: foo |
foo: foo, |
||||
|
bar: bar |
||||
}); |
}); |
||||
|
|
||||
const x = 'foo'; |
console.log( Object.keys( namespace ) ); |
||||
assert.equal( namespace[x], 42 ); |
|
||||
|
|
||||
}()); |
const a = 1; |
||||
|
const b = 2; |
||||
|
|
||||
|
exports.a = a; |
||||
|
exports.b = b; |
||||
|
|
||||
|
}((this.myBundle = this.myBundle || {}))); |
||||
|
@ -1,17 +1,24 @@ |
|||||
(function (global, factory) { |
(function (global, factory) { |
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory() : |
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : |
||||
typeof define === 'function' && define.amd ? define(factory) : |
typeof define === 'function' && define.amd ? define(['exports'], factory) : |
||||
(factory()); |
(factory((global.myBundle = global.myBundle || {}))); |
||||
}(this, (function () { 'use strict'; |
}(this, (function (exports) { 'use strict'; |
||||
|
|
||||
const foo = 42; |
const foo = 1; |
||||
|
const bar = 2; |
||||
|
|
||||
|
|
||||
var namespace = (Object.freeze || Object)({ |
var namespace = (Object.freeze || Object)({ |
||||
foo: foo |
foo: foo, |
||||
|
bar: bar |
||||
}); |
}); |
||||
|
|
||||
const x = 'foo'; |
console.log( Object.keys( namespace ) ); |
||||
assert.equal( namespace[x], 42 ); |
|
||||
|
const a = 1; |
||||
|
const b = 2; |
||||
|
|
||||
|
exports.a = a; |
||||
|
exports.b = b; |
||||
|
|
||||
}))); |
}))); |
||||
|
@ -1,4 +1,6 @@ |
|||||
import * as namespace from './namespace.js'; |
import * as namespace from './namespace.js'; |
||||
|
|
||||
const x = 'foo'; |
console.log( Object.keys( namespace ) ); |
||||
assert.equal( namespace[x], 42 ); |
|
||||
|
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