@@ -8,6 +8,7 @@ var header = constants.licenseDist + '\n';
88var allTransforms = constants . allTransforms ;
99var allTraces = constants . allTraces ;
1010var mainIndex = constants . mainIndex ;
11+ var strictIndex = constants . strictIndex ;
1112
1213// Bundle the plotly.js partial bundles
1314module . exports = function partialBundle ( tasks , opts ) {
@@ -19,11 +20,12 @@ module.exports = function partialBundle(tasks, opts) {
1920 var traceList = opts . traceList ;
2021 var transformList = opts . transformList ;
2122 var calendars = opts . calendars ;
23+ var strict = opts . strict ;
2224
2325 // skip strict bundle which is no longer a partial bundle and has a special index file for regl traces
2426 if ( name !== 'strict' ) {
2527 tasks . push ( function ( done ) {
26- var partialIndex = mainIndex ;
28+ var partialIndex = ( strict ) ? strictIndex : mainIndex ;
2729
2830 var all = [ 'calendars' ] . concat ( allTransforms ) . concat ( allTraces ) ;
2931 var includes = ( calendars ? [ 'calendars' ] : [ ] ) . concat ( transformList ) . concat ( traceList ) ;
@@ -32,12 +34,11 @@ module.exports = function partialBundle(tasks, opts) {
3234 excludes . forEach ( function ( t ) {
3335 var WHITESPACE_BEFORE = '\\s*' ;
3436 // 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' ) , '' ) ;
4142
4243 // test removal
4344 if ( newCode === partialIndex ) {
0 commit comments