Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue with umd noConflict bundle + named exports. In such case …
…undefined got exported as module.
- Loading branch information
Showing
10 changed files
with
134 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
description: 'exports noConflict method for default umd when requested', | ||
options: { | ||
noConflict: true, | ||
moduleName: 'my.name.spaced.module' | ||
} | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
function doThings() { | ||
console.log( 'doing things...' ); | ||
} | ||
|
||
const number = 42; | ||
|
||
var setting = 'no'; | ||
|
||
exports.doThings = doThings; | ||
exports.number = number; | ||
exports.setting = setting; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
function doThings() { | ||
console.log( 'doing things...' ); | ||
} | ||
|
||
const number = 42; | ||
|
||
var setting = 'no'; | ||
|
||
exports.doThings = doThings; | ||
exports.number = number; | ||
exports.setting = setting; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function doThings() { | ||
console.log( 'doing things...' ); | ||
} | ||
|
||
const number = 42; | ||
|
||
var setting = 'no'; | ||
|
||
export { doThings, number, setting }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
this.my = this.my || {}; | ||
this.my.name = this.my.name || {}; | ||
this.my.name.spaced = this.my.name.spaced || {}; | ||
this.my.name.spaced.module = (function (exports) { | ||
'use strict'; | ||
|
||
function doThings() { | ||
console.log( 'doing things...' ); | ||
} | ||
|
||
const number = 42; | ||
|
||
var setting = 'no'; | ||
|
||
exports.doThings = doThings; | ||
exports.number = number; | ||
exports.setting = setting; | ||
|
||
}({})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(function() { | ||
var current = global.my && global.my.name && global.my.name.spaced && global.my.name.spaced.module; | ||
var exports = (global.my = global.my || {}, global.my.name = global.my.name || {}, global.my.name.spaced = global.my.name.spaced || {}, global.my.name.spaced.module = {}); | ||
factory(exports); | ||
global.my.name.spaced.module = exports; | ||
exports.noConflict = function() { global.my.name.spaced.module = current; return exports; }; | ||
})(); | ||
}(this, (function (exports) { 'use strict'; | ||
|
||
function doThings() { | ||
console.log( 'doing things...' ); | ||
} | ||
|
||
const number = 42; | ||
|
||
var setting = 'no'; | ||
|
||
exports.doThings = doThings; | ||
exports.number = number; | ||
exports.setting = setting; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export function doThings() { | ||
console.log( 'doing things...' ); | ||
} | ||
|
||
export const number = 42; | ||
|
||
export var setting = 'no'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters