From 3c47c47f7215f89c1df50fb04024b926c4068089 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Sun, 10 Sep 2017 12:44:21 -0700 Subject: [PATCH] fix AMD bundle by hacking around check in `he` module; closes #3000 --- scripts/dedefine.js | 3 +-- scripts/travis-before-script.sh | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/dedefine.js b/scripts/dedefine.js index 3e297586c9..850fde3833 100644 --- a/scripts/dedefine.js +++ b/scripts/dedefine.js @@ -6,8 +6,7 @@ */ var through = require('through2'); -var defineRx = /typeof define === ['"]function['"] && define\.amd/g; - +var defineRx = /typeof\s+define\s*===?\s*['"]function['"]\s*&&\s*(?:define\.amd|typeof\s+define\.amd\s*===?\s*['"]object['"]\s*&&\s*define\.amd)/g; function createStream () { return through.obj(function (chunk, enc, next) { this.push(String(chunk) diff --git a/scripts/travis-before-script.sh b/scripts/travis-before-script.sh index 3e8a45c0bf..f636a88abf 100755 --- a/scripts/travis-before-script.sh +++ b/scripts/travis-before-script.sh @@ -2,3 +2,6 @@ # bundle artifacts to AWS go here mkdir -p .karma + +# ensure we are building a non-broken bundle for AMD +make BUILDTMP/mocha.js && [[ -z "$(grep 'define.amd' BUILDTMP/mocha.js)" ]] || exit 1