-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix library's imported name using requirejs
AMD loader
#6440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
16f1d1f
set umdNamedDefine to false - fix AMD import in docs
archmoj f23051a
set umdNamedDefine to false in dashboard & karma config
archmoj 5499547
use centralized webpack config.output.library options
archmoj e32ba76
rename requirejs to amdefine test then add new requirejs test
archmoj 40cecb6
draft log for PR 6440
archmoj 4fd73a7
Update devtools/test_dashboard/server.js
archmoj 9da2ce0
fixup Tabs
archmoj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -3,5 +3,6 @@ node_modules | |
dist | ||
build | ||
|
||
tasks/test_amdefine.js | ||
tasks/test_requirejs.js | ||
test/jasmine/assets/jquery-1.8.3.min.js |
This file contains hidden or 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 hidden or 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 hidden or 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,28 @@ | ||
var JSDOM = require('jsdom').JSDOM; | ||
global.document = new JSDOM('<!DOCTYPE html><head></head><html><body></body></html>').window.document; | ||
global.window = document.defaultView; | ||
global.window.document = global.document; | ||
global.self = global.window; | ||
global.Blob = global.window.Blob; | ||
global.DOMParser = global.window.DOMParser; | ||
global.getComputedStyle = global.window.getComputedStyle; | ||
global.window.URL.createObjectURL = function() {}; | ||
|
||
// see: Building node modules with AMD or RequireJS https://requirejs.org/docs/node.html | ||
if(typeof define !== 'function') { | ||
var define = require('amdefine')(module); | ||
} | ||
|
||
define(function(require) { | ||
var plotly = require('../dist/plotly.min.js'); | ||
|
||
if(plotly) { | ||
console.log(plotly); | ||
} else { | ||
throw 'Error: loading with amdefine'; | ||
} | ||
|
||
// The value returned from the function is | ||
// used as the module export visible to Node. | ||
return function() {}; | ||
}); |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.