@@ -8,6 +8,7 @@ var header = constants.licenseDist + '\n';
8
8
var allTransforms = constants . allTransforms ;
9
9
var allTraces = constants . allTraces ;
10
10
var mainIndex = constants . mainIndex ;
11
+ var strictIndex = constants . strictIndex ;
11
12
12
13
// Bundle the plotly.js partial bundles
13
14
module . exports = function partialBundle ( tasks , opts ) {
@@ -19,11 +20,12 @@ module.exports = function partialBundle(tasks, opts) {
19
20
var traceList = opts . traceList ;
20
21
var transformList = opts . transformList ;
21
22
var calendars = opts . calendars ;
23
+ var strict = opts . strict ;
22
24
23
25
// skip strict bundle which is no longer a partial bundle and has a special index file for regl traces
24
26
if ( name !== 'strict' ) {
25
27
tasks . push ( function ( done ) {
26
- var partialIndex = mainIndex ;
28
+ var partialIndex = ( strict ) ? strictIndex : mainIndex ;
27
29
28
30
var all = [ 'calendars' ] . concat ( allTransforms ) . concat ( allTraces ) ;
29
31
var includes = ( calendars ? [ 'calendars' ] : [ ] ) . concat ( transformList ) . concat ( traceList ) ;
@@ -32,12 +34,11 @@ module.exports = function partialBundle(tasks, opts) {
32
34
excludes . forEach ( function ( t ) {
33
35
var WHITESPACE_BEFORE = '\\s*' ;
34
36
// remove require
35
- var newCode = partialIndex . replace (
36
- new RegExp (
37
- WHITESPACE_BEFORE +
38
- 'require\\(\'\\./' + t + '\'\\),' ,
39
- 'g' ) , ''
40
- ) ;
37
+ var regEx = WHITESPACE_BEFORE + 'require\\(\'\\./' + t + '\'\\),' ;
38
+ if ( strict ) {
39
+ regEx += '|require\\(\'\\.\\./src/traces/' + t + '/strict\'\\),' ;
40
+ }
41
+ var newCode = partialIndex . replace ( new RegExp ( regEx , 'g' ) , '' ) ;
41
42
42
43
// test removal
43
44
if ( newCode === partialIndex ) {
0 commit comments