Skip to content

Instantly share code, notes, and snippets.

@JeroenVinke
Created February 24, 2017 09:16
Show Gist options
  • Save JeroenVinke/10ac6437f8c87377cda6f3e113b63a62 to your computer and use it in GitHub Desktop.
Save JeroenVinke/10ac6437f8c87377cda6f3e113b63a62 to your computer and use it in GitHub Desktop.
require.config({
paths: {
"my-plugin": "./my-plugin"
}
});
define("my-plugin", []);
define(["my-plugin!./test.css"], function (r) {
console.log(r)
})
<!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>
define("my-plugin", function (input) {
return {
normalize: function (i) {
return i;
},
load: function (name, req, onLoad, config) {
return onLoad("some content");
}
}
})
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