Skip to content

Commit

Permalink
fix Mismatched anonymous define() module
Browse files Browse the repository at this point in the history
  • Loading branch information
nuysoft committed Apr 13, 2015
1 parent 291c389 commit 49f56d2
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ build
*.TODO
PLAN.md
xhr.js
bak
MockHttpRequest.js
coverage
4 changes: 2 additions & 2 deletions dist/mock-min.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions dist/mock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! mockjs 05-03-2015 15:35:16 */
/*! mockjs 13-04-2015 14:26:58 */
/*! src/mock-prefix.js */
/*!
Mock - 模拟请求 & 模拟数据
Expand Down Expand Up @@ -1056,7 +1056,10 @@
if (typeof module === "object" && module.exports) {
module.exports = Mock;
} else if (typeof define === "function" && define.amd) {
define(function() {
define("mock", [], function() {
return Mock;
});
define("mockjs", [], function() {
return Mock;
});
} else if (typeof define === "function" && define.cmd) {
Expand Down
2 changes: 1 addition & 1 deletion mock-min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mockjs",
"title": "Mock.js",
"description": "模拟请求 & 模拟数据",
"version": "0.1.6",
"version": "0.1.9",
"homepage": "http://mockjs.com/",
"keywords": [
"mock",
Expand Down
5 changes: 4 additions & 1 deletion src/expose.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ if (typeof module === 'object' && module.exports) {

} else if (typeof define === "function" && define.amd) {
// AMD modules
define(function() {
define('mock', [], function() {
return Mock
})
define('mockjs', [], function() {
return Mock
})

Expand Down
2 changes: 1 addition & 1 deletion src/mock-prefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
*/
(function(undefined) {
var Mock = {
version: '0.1.8',
version: '0.1.9',
_mocked: {}
}

0 comments on commit 49f56d2

Please sign in to comment.