Created
February 24, 2017 09:16
-
-
Save JeroenVinke/10ac6437f8c87377cda6f3e113b63a62 to your computer and use it in GitHub Desktop.
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
require.config({ | |
paths: { | |
"my-plugin": "./my-plugin" | |
} | |
}); | |
define("my-plugin", []); | |
define(["my-plugin!./test.css"], function (r) { | |
console.log(r) | |
}) |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>GistRun</title> | |
</head> | |
<body> | |
<h1>Hello world!</h1> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.3/require.js" data-main="failing"></script> | |
<!--<script src="./text.js"></script>--> | |
</body> | |
</html> |
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
define("my-plugin", function (input) { | |
return { | |
normalize: function (i) { | |
return i; | |
}, | |
load: function (name, req, onLoad, config) { | |
return onLoad("some content"); | |
} | |
} | |
}) |
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
define("my-plugin", function (input) { | |
return { | |
normalize: function (i) { | |
return i; | |
}, | |
load: function (name, req, onLoad, config) { | |
return onLoad("some content"); | |
} | |
} | |
}) | |
define("my-plugin", []); | |
define(["my-plugin!./test.css"], function (r) { | |
console.log(r) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment