This repository was archived by the owner on Dec 4, 2023. It is now read-only.
File tree 3 files changed +29
-2
lines changed
3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ all: mocha.js
13
13
mocha.js : $(SRC ) browser-entry.js
14
14
@printf " ==> [Browser :: build]\n"
15
15
$(BROWSERIFY ) ./browser-entry \
16
+ --plugin ./scripts/dedefine \
16
17
--ignore ' fs' \
17
18
--ignore ' glob' \
18
19
--ignore ' path' \
Original file line number Diff line number Diff line change @@ -9314,7 +9314,7 @@ function objectToString(o) {
9314
9314
/*global module */
9315
9315
if ( typeof module !== 'undefined' && module . exports ) {
9316
9316
module . exports = JsDiff ;
9317
- } else if ( typeof define === 'function' && define . amd ) {
9317
+ } else if ( false ) {
9318
9318
/*global define */
9319
9319
define ( [ ] , function ( ) { return JsDiff ; } ) ;
9320
9320
} else if ( typeof global . JsDiff === 'undefined' ) {
@@ -10076,7 +10076,7 @@ module.exports = Array.isArray || function (arr) {
10076
10076
; ( function ( ) {
10077
10077
// Detect the `define` function exposed by asynchronous module loaders. The
10078
10078
// strict `define` check is necessary for compatibility with `r.js`.
10079
- var isLoader = typeof define === "function" && define . amd ;
10079
+ var isLoader = false ;
10080
10080
10081
10081
// A set of types used to distinguish objects from primitives.
10082
10082
var objectTypes = {
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ /**
4
+ * This is a transform stream we're using to strip AMD calls from
5
+ * dependencies in our Browserify bundle.
6
+ */
7
+
8
+ var through = require ( 'through2' ) ;
9
+ var defineRx = / t y p e o f d e f i n e = = = [ ' " ] f u n c t i o n [ ' " ] & & d e f i n e \. a m d / g;
10
+
11
+ function createStream ( ) {
12
+ return through . obj ( function ( chunk , enc , next ) {
13
+ this . push ( String ( chunk )
14
+ . replace ( defineRx , 'false' ) ) ;
15
+ next ( ) ;
16
+ } ) ;
17
+ }
18
+
19
+ module . exports = function ( b ) {
20
+ function wrap ( ) {
21
+ b . pipeline . get ( 'wrap' ) . push ( createStream ( ) ) ;
22
+ }
23
+
24
+ b . on ( 'reset' , wrap ) ;
25
+ wrap ( ) ;
26
+ } ;
You can’t perform that action at this time.
0 commit comments