Skip to content
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

Add support for Dojo AMD loader. #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "requirejs-plugins",
"version": "1.0.3",
"description": "Small set of plugins for [RequireJS](http://requirejs.org). GJS added support for DOJO AMD Loader.",
"main": "src/json.js",
"directories": {
"example": "examples"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "[email protected]:GordonSmith/requirejs-plugins.git"
},
"author": "Gordon Smith <[email protected]>",
"license": "ISC",
"bugs": {
"url": "https://github.com/GordonSmith/requirejs-plugins/issues"
},
"homepage": "https://github.com/GordonSmith/requirejs-plugins"
}
2 changes: 1 addition & 1 deletion src/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ define(function(){

return{
load : function(name, req, onLoad, config){
if(config.isBuild){
if(config && config.isBuild){
onLoad(null); //avoid errors on the optimizer
}else{
var id = uid();
Expand Down
2 changes: 1 addition & 1 deletion src/font.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ define(['propertyParser'], function (propertyParser) {

//example: font!google,families:[Tangerine,Cantarell,Yanone Kaffeesatz:700]
load : function(name, req, onLoad, config){
if (config.isBuild) {
if (config && config.isBuild) {
onLoad(null); //avoid errors on the optimizer
} else {
var data = parseName(name);
Expand Down
2 changes: 1 addition & 1 deletion src/goog.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ define(['async', 'propertyParser'], function (async, propertyParser) {

return {
load : function(name, req, onLoad, config){
if (config.isBuild) {
if (config && config.isBuild) {
onLoad(null); //avoid errors on the optimizer
} else {
var data = parseName(name),
Expand Down
2 changes: 1 addition & 1 deletion src/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ define(function(){
return {
load : function(name, req, onLoad, config){
var img;
if(config.isBuild){
if(config && config.isBuild) {
onLoad(null); //avoid errors on the optimizer since it can't inline image files
}else{
img = new Image();
Expand Down
2 changes: 1 addition & 1 deletion src/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ define(['text'], function(text){
return {

load : function(name, req, onLoad, config) {
if (( config.isBuild && (config.inlineJSON === false || name.indexOf(CACHE_BUST_QUERY_PARAM +'=') !== -1)) || (req.toUrl(name).indexOf('empty:') === 0)) {
if (( config && config.isBuild && (config.inlineJSON === false || name.indexOf(CACHE_BUST_QUERY_PARAM + '=') !== -1)) || (req.toUrl(name).indexOf('empty:') === 0)) {
//avoid inlining cache busted JSON or if inlineJSON:false
//and don't inline files marked as empty!
onLoad(null);
Expand Down
2 changes: 1 addition & 1 deletion src/mdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ define(
//>>excludeStart('excludeMdown', pragmas.excludeMdown)
text.get(req.toUrl(name), function(data){
data = markdownConverter.makeHtml(data);
if (config.isBuild) {
if (config && config.isBuild) {
buildMap[name] = data;
onLoad(data);
} else {
Expand Down