Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
grunt.task.registerTask('browserify:debug', 'Generate debug files', function() {
var done = this.async(),
fs = require('fs'),
output_stream = fs.createWriteStream('debug/js-2dmath-browser-debug.js');
argumentify.verbose();
argumentify.customValidators(argumentify_validators);
require('browserify')()
.require('./index.js', {expose: "js-2dmath"})
.transform('argumentify')
.bundle({
debug: true
})
.pipe(output_stream);
output_stream.on("close", function() {
grunt.log.ok("work done");
done();
});
});
function produce3DBundle() {
var bundle = require('browserify')()
.require('./src/scripts/viewer/3d/renderer3d.js', { expose: 'renderer3d' });
bundle
.bundle()
.on('error', function (err) {
gutil.log(gutil.colors.red('Failed to browserify render3d'), gutil.colors.yellow(err.message));
})
.pipe(fs.createWriteStream(path.join(__dirname + '/dist/renderer3d.js')));
}
grunt.task.registerTask('browserify:dist', 'Generate debug files', function() {
var done = this.async(),
browserify = require('browserify'),
fs = require('fs'),
stream;
require('browserify')()
.require('./index.js', {expose: "js-2dmath"})
//.transform('funlinify')
.bundle()
.pipe(fs.createWriteStream('dist/js-2dmath-browser.js'))
.on("close", function() {
done();
});
});
var build = module.exports = function () {
return require('browserify')()
.require(require.resolve('./main.js'), { entry: true })
.bundle({ debug: true })
.pipe(require('mold-source-map').transformSourcesRelativeTo(__dirname + '/../'));
};