// Dependencies. var through = require('through2'); var PluginError = require('plugin-error'); const fs = require('fs'); const constantModule = __dirname + '/../../../dist/preview release/babylon.max'; let _babylonConstants = undefined; function getBabylonConstants() { if (!_babylonConstants) { _babylonConstants = require(constantModule).Constants; } return _babylonConstants; } /** * Replace all constants by their inlined values. */ function processConstants(sourceCode) { const babylonConstants = getBabylonConstants(); var regexImport = /import { Constants } from .*;/g; sourceCode = sourceCode.replace(regexImport, ""); var regexConstant = /(? 1) { constantList.push(constantName); } match = regexConstant.exec(sourceCode); } for (var constant of constantList) { var regex = new RegExp(`(?