<commit_before>var gutil = require('gulp-util');
var through = require('through2');

module.exports = function (varName, subModule, extendsRoot) {
    return through.obj(function (file, enc, cb) {

        var optionalRequire = 'var BABYLON = BABYLON || (typeof require !== \'undefined\' && require("babylonjs"));\n'

        function moduleExportAddition(varName) {

            let basicInit = `root["BABYLON"]${(subModule && !extendsRoot) ? '["' + varName + '"]' : ''} = factory();`;
            /*if (extendsRoot) {
                basicInit = `__extends(root["BABYLON"], factory()); `
            }*/

            return `\n\n(function universalModuleDefinition(root, factory) {
                if (root && root["BABYLON"]) {
                    return;
                }<commit_msg>load local dependency for local-development. This will first try to load a local dependency of babylon.max (in the parent directory). afterwards it will try loading babylonjs as npm dependency.<commit_after>var gutil = require('gulp-util');
var through = require('through2');

module.exports = function (varName, subModule, extendsRoot) {
    return through.obj(function (file, enc, cb) {

        var optionalRequire = `var babylonDependency; try { babylonDependency = (typeof require !== 'undefined' && require("../babylon.max")); } catch (e) { babylonDependency = (typeof require !== 'undefined' && require("babylonjs")); } 
var BABYLON = BABYLON || babylonDependency;
`
        function moduleExportAddition(varName) {

            let basicInit = `root["BABYLON"]${(subModule && !extendsRoot) ? '["' + varName + '"]' : ''} = factory();`;
            /*if (extendsRoot) {
                basicInit = `__extends(root["BABYLON"], factory()); `
            }*/

            return `\n\n(function universalModuleDefinition(root, factory) {
                if (root && root["BABYLON"]) {
                    return;
                }
{'fraction_non_alphanumeric': 0.15208333333333332, 'fraction_numerical': 0.0010416666666666667, 'mean_word_length': 2.7964426877470356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3812416', 'n_tokens_mistral': 565, 'n_tokens_neox': 530, 'n_words': 132}