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GAGtB,CAlJA,aAEA,OAAO,OAAO,cAAc,SAAS,EAAK,EAAQ,EAAS,GACvD,IAAI,EAAQ,SAAS,EAAK,EAAS,GAEnC,IAAI,OAAO,KAAK,cAAc,SAAS,EAAG,GACtC,IAAI,EAAS,EAAO,GAAG,WAAW,SAAS,QACrC,eACA,iBAuBN,OArBA,OAAS,SAAS,EAAQ,GACtB,OACI,EACC,SACA,GAAG,SAAS,SAAS,IAClB,IAAI,OAAO,cAAe,MACtB,EAAG,sBAGP,KAAK,KAAK,MACd,IACC,KAAK,OAAO,EAAM,OAAO,OACzB,KAAK,UACL,KAAK,EAAE,GAAG,EAAO,WAAY,EAAE,WAAW,KAAK,CAAE,UAAU,MAC3D,KAAK,EAAE,GAAG,EAAO,WAAY,EAAE,OAAO,EAAO,GAAG,OAAO,WACvD,KAAK,EAAE,GAAG,EAAO,WAAY,EAAE,WAAW,MAAM,OAChD,KAAK,KAAK,KAAK,EAAM,OAAO,UAC5B,KAAK,IAAI,OAAO,aAAa,wBAEtC,EAAE,KAAK,MAEA,OACH,EAAO,CACH,MAAO,EACP,QAAS,GAAW,EAAO,GAAG,WAAW,UAE7C,EAER,GAAG,GACF,OACL","file":"/npm/laravel-elixir-browserify-official@0.1.3/browserify.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/laravel-elixir-browserify-official@0.1.3/browserify.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","var Elixir = require('laravel-elixir');\nvar gulp = require('gulp');\nvar config = Elixir.config;\nvar browserify = require('browserify');\nvar watchify = require('watchify');\nvar gutil = require('gulp-util');\nvar buffer = require('vinyl-buffer');\nvar source = require('vinyl-source-stream');\nvar bundle;\n\n/*\n |----------------------------------------------------------------\n | Browserify Task\n |----------------------------------------------------------------\n |\n | This task will manage your entire Browserify workflow, from\n | scratch! Also, it will channel all files through Babelify\n | so that you may use all the ES6 goodness you can stand.\n |\n */\n\nloadConfig();\n\nElixir.extend('browserify', function(src, output, baseDir, options) {\n    var paths = getPaths(src, baseDir, output);\n\n    new Elixir.Task('browserify', function($, config) {\n        var stream = config.js.browserify.watchify.enabled\n            ? watchifyStream\n            : browserifyStream;\n\n        bundle = function(stream, paths) {\n            return (\n                stream\n                .bundle()\n                .on('error', function(e) {\n                    new Elixir.Notification().error(\n                        e, 'Browserify Failed!'\n                    );\n\n                    this.emit('end');\n                })\n                .pipe(source(paths.output.name))\n                .pipe(buffer())\n                .pipe($.if(config.sourcemaps, $.sourcemaps.init({ loadMaps: true })))\n                .pipe($.if(config.production, $.uglify(config.js.uglify.options)))\n                .pipe($.if(config.sourcemaps, $.sourcemaps.write('.')))\n                .pipe(gulp.dest(paths.output.baseDir))\n                .pipe(new Elixir.Notification('Browserify Compiled!'))\n            );\n        }.bind(this);\n\n        return bundle(\n            stream({\n                paths: paths,\n                options: options || config.js.browserify.options\n            }),\n            paths\n        );\n    }, paths)\n    .watch(); // Register a watcher, but Watchify will do the workload.\n});\n\n\n/**\n * Prep the Gulp src and output paths.\n *\n * @param  {string|Array} src\n * @param  {string|null}  baseDir\n * @param  {string|null}  output\n * @return {GulpPaths}\n */\n function getPaths(src, baseDir, output) {\n    return new Elixir.GulpPaths()\n        .src(src, baseDir || config.get('assets.js.folder'))\n        .output(output || config.get('public.js.outputFolder'), 'bundle.js');\n}\n\n\n/**\n * Get a standard Browserify stream.\n *\n * @param {object} data\n */\nfunction browserifyStream(data) {\n    var stream = browserify(data.paths.src.path, data.options);\n\n    config.js.browserify.transformers.forEach(function(transformer) {\n        stream.transform(\n            require(transformer.name), transformer.options || {}\n        );\n    });\n\n    config.js.browserify.plugins.forEach(function(plugin) {\n        stream.plugin(\n            require(plugin.name), plugin.options || {}\n        );\n    });\n\n    config.js.browserify.externals.forEach(function(external) {\n        stream.external(external);\n    });\n\n    return stream;\n}\n\n\n/**\n * Get a Browserify stream, wrapped in Watchify.\n *\n * @param {object} data\n */\nfunction watchifyStream(data) {\n    var browserify = watchify(\n        browserifyStream(data),\n        config.js.browserify.watchify.options\n    );\n\n    browserify.on('log', gutil.log);\n    browserify.on('update', function () {\n        bundle(browserify, data.paths);\n    });\n\n    return browserify;\n}\n\n\n/**\n * Load the default Browserify config.\n */\nfunction loadConfig() {\n    config.js.browserify = {\n        // https://www.npmjs.com/package/browserify#usage\n        options: {\n            cache: {},\n            packageCache: {}\n        },\n\n        plugins: [],\n\n        externals: [],\n\n        transformers: [\n            {\n                name: 'babelify',\n\n                // https://www.npmjs.com/package/gulp-babel#babel-options\n                options: {\n                    presets: ['es2015', 'react']\n                }\n            },\n\n            {\n                name: 'partialify',\n\n                // https://www.npmjs.com/package/partialify\n                options: {}\n            }\n        ],\n\n        watchify: {\n            enabled: Elixir.isWatching(),\n\n            // https://www.npmjs.com/package/watchify#usage\n            options: {}\n        }\n    };\n}\n"]}