forked from requirejs/requirejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes requirejs#1472, allow plugin use in data-main
- Loading branch information
Showing
6 changed files
with
42 additions
and
2 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,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>require.js: data-main plugin Test</title> | ||
<script type="text/javascript" src="../../doh/runner.js"></script> | ||
<script type="text/javascript" src="../../doh/_browserRunner.js"></script> | ||
<script type="text/javascript" data-main="my/plugin!sub/test" src="../../../require.js"></script> | ||
</head> | ||
<body> | ||
<h1>require.js: data-main plugin Test</h1> | ||
|
||
<p>Confirm that a data-main="som/plugin!some/value" works. More info: | ||
<a href="https://github.com/requirejs/requirejs/issues/1472">1472</a>. | ||
|
||
<p>Check console for messages</p> | ||
</body> | ||
</html> |
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,3 @@ | ||
define({ | ||
name: 'a' | ||
}); |
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,11 @@ | ||
define(['./a'], function (a) { | ||
doh.register( | ||
"dataMainPlugin", | ||
[ | ||
function dataMainPlugin(t){ | ||
t.is("a", a.name); | ||
} | ||
] | ||
); | ||
doh.run(); | ||
}); |
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,6 @@ | ||
define({ | ||
load: function( name, req, onload, config ) { | ||
requirejs.config({ baseUrl: './modules' }); | ||
req([name], onload); | ||
} | ||
}); |