forked from OpenNTF/dojo-webpack-plugin
-
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.
- Loading branch information
1 parent
20f5dd4
commit bafd9a3
Showing
28 changed files
with
158 additions
and
14 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
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,6 @@ | ||
/* global cjsRequire */ | ||
define([], function() { | ||
it("should load CommonJS modules from async chunk", function() { | ||
cjsRequire("./cjsModule2").should.be.eql("cjs2"); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
module.exports = "cjs1"; |
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 @@ | ||
module.exports = "cjs2"; |
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
/* global cjsRequire */ | ||
define(["./amdModule"], function(amd) { | ||
it("should load CommonJS modules using cjsRequire", function() { | ||
it("should load CommonJS modules using cjsRequire", function(done) { | ||
amd.should.be.eql("amd"); | ||
cjsRequire("./cjsModule").should.be.eql("cjs"); | ||
cjsRequire("./cjsModule1").should.be.eql("cjs1"); | ||
require(["asyncDep"], function() { | ||
done(); | ||
}); | ||
}); | ||
}); |
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
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,9 @@ | ||
define([], function() { | ||
return { | ||
load: function(name, req, callback) { | ||
req(["dojo/text!" + name], function(text) { | ||
callback("Header\n"+text); | ||
}); | ||
} | ||
}; | ||
}); |
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 @@ | ||
content |
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,5 @@ | ||
define(["addHeaderPlugin!./content.txt"], function(contentWithHeader) { | ||
it("should add header to content", function() { | ||
"Header\ncontent".should.be.eql(contentWithHeader); | ||
}); | ||
}); |
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,20 @@ | ||
var path = require("path"); | ||
var webpack = require("webpack"); | ||
var DojoWebpackPlugin = require("../../../../index"); | ||
|
||
module.exports = { | ||
entry: "test/index", | ||
plugins: [ | ||
new DojoWebpackPlugin({ | ||
loaderConfig: { | ||
paths:{test: "."} | ||
}, | ||
loader: path.join(__dirname, "../../../js/dojo/dojo.js") | ||
}), | ||
new webpack.NormalModuleReplacementPlugin( | ||
/^addHeaderPlugin!/, function(data) { | ||
var match = /^addHeaderPlugin!(.*)$/.exec(data.request); | ||
data.request = "dojo/loaderProxy?loader=./addHeaderPlugin&deps=dojo/text%21" + match[1] + "!" + match[1]; | ||
} | ||
) ] | ||
}; |
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,5 @@ | ||
define(["dojo/request/default!"], function(request) { | ||
it("should load request/xhr", function() { | ||
"dojo/request/xhr".should.be.eql(request); | ||
}); | ||
}); |
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,7 @@ | ||
define([], function() { | ||
it("should compile", function(done) { | ||
require(["dep"], function() { | ||
done(); | ||
}); | ||
}); | ||
}); |
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([], function() { | ||
return "dojo/request/xhr"; | ||
}); |
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,18 @@ | ||
var path = require("path"); | ||
var DojoWebpackPlugin = require("../../../../index"); | ||
module.exports = { | ||
entry: "test/index", | ||
plugins: [ | ||
new DojoWebpackPlugin({ | ||
loaderConfig: { | ||
paths:{test: "."} | ||
}, | ||
loader: path.join(__dirname, "../../../js/dojo/dojo.js") | ||
}) | ||
], | ||
resolve: { | ||
alias: { | ||
'dojo/request/xhr': path.join(__dirname, "./request.js") | ||
} | ||
} | ||
}; |
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,5 @@ | ||
define(["dojo/selector/_loader!"], function(selector) { | ||
it("should load selector/lite", function() { | ||
"dojo/selector/lite".should.be.eql(selector); | ||
}); | ||
}); |
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([], function() { | ||
return "dojo/selector/lite"; | ||
}); |
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,18 @@ | ||
var path = require("path"); | ||
var DojoWebpackPlugin = require("../../../../index"); | ||
module.exports = { | ||
entry: "test/index", | ||
plugins: [ | ||
new DojoWebpackPlugin({ | ||
loaderConfig: { | ||
paths:{test: "."} | ||
}, | ||
loader: path.join(__dirname, "../../../js/dojo/dojo.js") | ||
}) | ||
], | ||
resolve: { | ||
alias: { | ||
'dojo/selector/lite': path.join(__dirname, "./selector.js") | ||
} | ||
} | ||
}; |
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 @@ | ||
hello |
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,5 @@ | ||
define(["dojo/text!test/hello.txt"], function(hello) { | ||
it("should load text files" , function() { | ||
"hello".should.be.eql(hello); | ||
}); | ||
}); |
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,13 @@ | ||
var path = require("path"); | ||
var DojoWebpackPlugin = require("../../../../index"); | ||
module.exports = { | ||
entry: "test/index", | ||
plugins: [ | ||
new DojoWebpackPlugin({ | ||
loaderConfig: { | ||
paths:{test: "."} | ||
}, | ||
loader: path.join(__dirname, "../../../js/dojo/dojo.js") | ||
}) | ||
] | ||
}; |