Skip to content

Commit 9a3ddeb

Browse files
committed
fix AMD bundle by hacking around check in he module; closes #3000
1 parent 337d317 commit 9a3ddeb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

scripts/dedefine.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
*/
77

88
var through = require('through2');
9-
var defineRx = /typeof define === ['"]function['"] && define\.amd/g;
10-
9+
var defineRx = /typeof\s+define\s*===?\s*['"]function['"]\s*&&\s*(?:define\.amd|typeof\s+define\.amd\s*===?\s*['"]object['"]\s*&&\s*define\.amd)/g;
1110
function createStream () {
1211
return through.obj(function (chunk, enc, next) {
1312
this.push(String(chunk)

scripts/travis-before-script.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
# bundle artifacts to AWS go here
44
mkdir -p .karma
5+
6+
# ensure we are building a non-broken bundle for AMD
7+
make BUILDTMP/mocha.js && [[ -z "$(grep 'define.amd' BUILDTMP/mocha.js)" ]] || exit 1

0 commit comments

Comments
 (0)