diff --git a/package.json b/package.json index c7ed5c7..5d057d7 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "npm run build && testem ci", "lint": "jshint --reporter=scripts/reporter.js scripts src", "prebuild": "npm run lint && npm run clean", - "build": "node scripts/bundle.js", + "build": "pixify --name pixi", "docs": "jsdoc -c scripts/jsdoc.conf.json -R README.md" }, "files": [ @@ -47,13 +47,9 @@ "resource-loader": "^1.6.4" }, "devDependencies": { - "browserify": "^13.0.1", "browserify-versionify": "^1.0.6", "chai": "^3.5.0", "del": "^2.2.0", - "gulp-empty": "^0.1.1", - "gulp-sourcemaps": "^1.6.0", - "gulp-uglify": "^2.0.0", "jaguarjs-jsdoc": "^1.0.0", "jsdoc": "^3.4.0", "jshint": "^2.9.2", @@ -63,12 +59,9 @@ "mkdirp": "^0.5.1", "mocha": "^2.5.3", "parallelshell": "^2.0.0", + "pixify": "^1.0.0", "rimraf": "^2.5.3", "testem": "^1.8.1", - "through2": "^2.0.1", - "vinyl-buffer": "^1.0.0", - "vinyl-fs": "^2.4.3", - "vinyl-source-stream": "^1.1.0", "watchify": "^3.7.0" }, "browserify": { @@ -77,4 +70,4 @@ "browserify-versionify" ] } -} +} \ No newline at end of file diff --git a/package.json b/package.json index c7ed5c7..5d057d7 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "npm run build && testem ci", "lint": "jshint --reporter=scripts/reporter.js scripts src", "prebuild": "npm run lint && npm run clean", - "build": "node scripts/bundle.js", + "build": "pixify --name pixi", "docs": "jsdoc -c scripts/jsdoc.conf.json -R README.md" }, "files": [ @@ -47,13 +47,9 @@ "resource-loader": "^1.6.4" }, "devDependencies": { - "browserify": "^13.0.1", "browserify-versionify": "^1.0.6", "chai": "^3.5.0", "del": "^2.2.0", - "gulp-empty": "^0.1.1", - "gulp-sourcemaps": "^1.6.0", - "gulp-uglify": "^2.0.0", "jaguarjs-jsdoc": "^1.0.0", "jsdoc": "^3.4.0", "jshint": "^2.9.2", @@ -63,12 +59,9 @@ "mkdirp": "^0.5.1", "mocha": "^2.5.3", "parallelshell": "^2.0.0", + "pixify": "^1.0.0", "rimraf": "^2.5.3", "testem": "^1.8.1", - "through2": "^2.0.1", - "vinyl-buffer": "^1.0.0", - "vinyl-fs": "^2.4.3", - "vinyl-source-stream": "^1.1.0", "watchify": "^3.7.0" }, "browserify": { @@ -77,4 +70,4 @@ "browserify-versionify" ] } -} +} \ No newline at end of file diff --git a/scripts/bundle.js b/scripts/bundle.js deleted file mode 100755 index 626cb3a..0000000 --- a/scripts/bundle.js +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env node - -var minimist = require('minimist'); -var browserify = require('browserify'); -var source = require('vinyl-source-stream'); -var buffer = require('vinyl-buffer'); -var vfs = require('vinyl-fs'); -var uglify = require('gulp-uglify'); -var empty = require('gulp-empty'); -var sourcemaps = require('gulp-sourcemaps'); -var path = require('path'); - -// Get the commandline arguments -var args = minimist(process.argv.slice(2), { - alias: { e: 'exclude' } -}); - -var bundler = browserify({ - entries: './src/', - debug: true -}); - -// Get the license for the header -var license = path.join(__dirname, 'license.js'); -bundler.plugin('./scripts/header.js', { file: license }); - -// Exclude certain modules -if (args.exclude) { - var excludes = args.exclude; - if (!Array.isArray(excludes)) { - excludes = [excludes]; - } - excludes.forEach(function(exclude){ - try { - bundler.ignore(require.resolve('../src/' + exclude)); - console.log('> Ignoring module \'%s\'', exclude); - } - catch(e){ - console.log('> ERROR: Module not found for \'%s\'', exclude); - } - }); - console.log(''); -} - -function bundle(output, debug) { - bundler.bundle() - .pipe(source(output)) - .pipe(buffer()) - .pipe(sourcemaps.init({loadMaps: true})) - .pipe(debug ? empty() : uglify({ - mangle: true, - preserveComments: function(node, comment) { - if (/\@preserve/m.test(comment.value)) { - return true; - } - } - })) - .pipe(sourcemaps.write('./')) - .pipe(vfs.dest('./bin/')); -} - -// Build the bundles -bundle('pixi.js', true); -bundle('pixi.min.js', false); diff --git a/package.json b/package.json index c7ed5c7..5d057d7 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "npm run build && testem ci", "lint": "jshint --reporter=scripts/reporter.js scripts src", "prebuild": "npm run lint && npm run clean", - "build": "node scripts/bundle.js", + "build": "pixify --name pixi", "docs": "jsdoc -c scripts/jsdoc.conf.json -R README.md" }, "files": [ @@ -47,13 +47,9 @@ "resource-loader": "^1.6.4" }, "devDependencies": { - "browserify": "^13.0.1", "browserify-versionify": "^1.0.6", "chai": "^3.5.0", "del": "^2.2.0", - "gulp-empty": "^0.1.1", - "gulp-sourcemaps": "^1.6.0", - "gulp-uglify": "^2.0.0", "jaguarjs-jsdoc": "^1.0.0", "jsdoc": "^3.4.0", "jshint": "^2.9.2", @@ -63,12 +59,9 @@ "mkdirp": "^0.5.1", "mocha": "^2.5.3", "parallelshell": "^2.0.0", + "pixify": "^1.0.0", "rimraf": "^2.5.3", "testem": "^1.8.1", - "through2": "^2.0.1", - "vinyl-buffer": "^1.0.0", - "vinyl-fs": "^2.4.3", - "vinyl-source-stream": "^1.1.0", "watchify": "^3.7.0" }, "browserify": { @@ -77,4 +70,4 @@ "browserify-versionify" ] } -} +} \ No newline at end of file diff --git a/scripts/bundle.js b/scripts/bundle.js deleted file mode 100755 index 626cb3a..0000000 --- a/scripts/bundle.js +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env node - -var minimist = require('minimist'); -var browserify = require('browserify'); -var source = require('vinyl-source-stream'); -var buffer = require('vinyl-buffer'); -var vfs = require('vinyl-fs'); -var uglify = require('gulp-uglify'); -var empty = require('gulp-empty'); -var sourcemaps = require('gulp-sourcemaps'); -var path = require('path'); - -// Get the commandline arguments -var args = minimist(process.argv.slice(2), { - alias: { e: 'exclude' } -}); - -var bundler = browserify({ - entries: './src/', - debug: true -}); - -// Get the license for the header -var license = path.join(__dirname, 'license.js'); -bundler.plugin('./scripts/header.js', { file: license }); - -// Exclude certain modules -if (args.exclude) { - var excludes = args.exclude; - if (!Array.isArray(excludes)) { - excludes = [excludes]; - } - excludes.forEach(function(exclude){ - try { - bundler.ignore(require.resolve('../src/' + exclude)); - console.log('> Ignoring module \'%s\'', exclude); - } - catch(e){ - console.log('> ERROR: Module not found for \'%s\'', exclude); - } - }); - console.log(''); -} - -function bundle(output, debug) { - bundler.bundle() - .pipe(source(output)) - .pipe(buffer()) - .pipe(sourcemaps.init({loadMaps: true})) - .pipe(debug ? empty() : uglify({ - mangle: true, - preserveComments: function(node, comment) { - if (/\@preserve/m.test(comment.value)) { - return true; - } - } - })) - .pipe(sourcemaps.write('./')) - .pipe(vfs.dest('./bin/')); -} - -// Build the bundles -bundle('pixi.js', true); -bundle('pixi.min.js', false); diff --git a/scripts/header.js b/scripts/header.js deleted file mode 100644 index 4c65398..0000000 --- a/scripts/header.js +++ /dev/null @@ -1,46 +0,0 @@ -var fs = require('fs'); -var through = require('through2'); - -/** - * Plugin for browserify to add custom header - * @param {browserify} browserify Instance of browserify - * @param {Object} options Options - */ -module.exports = function(browserify, options) { - - var packageInfo = require('../package.json'); - var substitute = { - date: (new Date()).toString(), - name: packageInfo.name, - version: packageInfo.version - }; - var header = fs.readFileSync(options.file, 'utf8'); - - // Subtitute values in the header template - for(var i in substitute) { - header = header.replace( - new RegExp('\\$\\{'+i+'\\}', 'g'), - substitute[i] - ); - } - var createStream = function () { - var firstChunk = true; - var stream = through.obj(function (buf, enc, next) { - if (firstChunk) { - /* insert the header comment as the first chunk */ - this.push(new Buffer(header)); - firstChunk = false; - } - this.push(buf); - next(); - }); - stream.label = 'header'; - return stream; - }; - - // hook into the bundle generation pipeline of Browserify - browserify.pipeline.get('wrap').push(createStream()); - browserify.on('reset', function () { - browserify.pipeline.get('wrap').push(createStream()); - }); -}; \ No newline at end of file diff --git a/package.json b/package.json index c7ed5c7..5d057d7 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test": "npm run build && testem ci", "lint": "jshint --reporter=scripts/reporter.js scripts src", "prebuild": "npm run lint && npm run clean", - "build": "node scripts/bundle.js", + "build": "pixify --name pixi", "docs": "jsdoc -c scripts/jsdoc.conf.json -R README.md" }, "files": [ @@ -47,13 +47,9 @@ "resource-loader": "^1.6.4" }, "devDependencies": { - "browserify": "^13.0.1", "browserify-versionify": "^1.0.6", "chai": "^3.5.0", "del": "^2.2.0", - "gulp-empty": "^0.1.1", - "gulp-sourcemaps": "^1.6.0", - "gulp-uglify": "^2.0.0", "jaguarjs-jsdoc": "^1.0.0", "jsdoc": "^3.4.0", "jshint": "^2.9.2", @@ -63,12 +59,9 @@ "mkdirp": "^0.5.1", "mocha": "^2.5.3", "parallelshell": "^2.0.0", + "pixify": "^1.0.0", "rimraf": "^2.5.3", "testem": "^1.8.1", - "through2": "^2.0.1", - "vinyl-buffer": "^1.0.0", - "vinyl-fs": "^2.4.3", - "vinyl-source-stream": "^1.1.0", "watchify": "^3.7.0" }, "browserify": { @@ -77,4 +70,4 @@ "browserify-versionify" ] } -} +} \ No newline at end of file diff --git a/scripts/bundle.js b/scripts/bundle.js deleted file mode 100755 index 626cb3a..0000000 --- a/scripts/bundle.js +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env node - -var minimist = require('minimist'); -var browserify = require('browserify'); -var source = require('vinyl-source-stream'); -var buffer = require('vinyl-buffer'); -var vfs = require('vinyl-fs'); -var uglify = require('gulp-uglify'); -var empty = require('gulp-empty'); -var sourcemaps = require('gulp-sourcemaps'); -var path = require('path'); - -// Get the commandline arguments -var args = minimist(process.argv.slice(2), { - alias: { e: 'exclude' } -}); - -var bundler = browserify({ - entries: './src/', - debug: true -}); - -// Get the license for the header -var license = path.join(__dirname, 'license.js'); -bundler.plugin('./scripts/header.js', { file: license }); - -// Exclude certain modules -if (args.exclude) { - var excludes = args.exclude; - if (!Array.isArray(excludes)) { - excludes = [excludes]; - } - excludes.forEach(function(exclude){ - try { - bundler.ignore(require.resolve('../src/' + exclude)); - console.log('> Ignoring module \'%s\'', exclude); - } - catch(e){ - console.log('> ERROR: Module not found for \'%s\'', exclude); - } - }); - console.log(''); -} - -function bundle(output, debug) { - bundler.bundle() - .pipe(source(output)) - .pipe(buffer()) - .pipe(sourcemaps.init({loadMaps: true})) - .pipe(debug ? empty() : uglify({ - mangle: true, - preserveComments: function(node, comment) { - if (/\@preserve/m.test(comment.value)) { - return true; - } - } - })) - .pipe(sourcemaps.write('./')) - .pipe(vfs.dest('./bin/')); -} - -// Build the bundles -bundle('pixi.js', true); -bundle('pixi.min.js', false); diff --git a/scripts/header.js b/scripts/header.js deleted file mode 100644 index 4c65398..0000000 --- a/scripts/header.js +++ /dev/null @@ -1,46 +0,0 @@ -var fs = require('fs'); -var through = require('through2'); - -/** - * Plugin for browserify to add custom header - * @param {browserify} browserify Instance of browserify - * @param {Object} options Options - */ -module.exports = function(browserify, options) { - - var packageInfo = require('../package.json'); - var substitute = { - date: (new Date()).toString(), - name: packageInfo.name, - version: packageInfo.version - }; - var header = fs.readFileSync(options.file, 'utf8'); - - // Subtitute values in the header template - for(var i in substitute) { - header = header.replace( - new RegExp('\\$\\{'+i+'\\}', 'g'), - substitute[i] - ); - } - var createStream = function () { - var firstChunk = true; - var stream = through.obj(function (buf, enc, next) { - if (firstChunk) { - /* insert the header comment as the first chunk */ - this.push(new Buffer(header)); - firstChunk = false; - } - this.push(buf); - next(); - }); - stream.label = 'header'; - return stream; - }; - - // hook into the bundle generation pipeline of Browserify - browserify.pipeline.get('wrap').push(createStream()); - browserify.on('reset', function () { - browserify.pipeline.get('wrap').push(createStream()); - }); -}; \ No newline at end of file diff --git a/scripts/license.js b/scripts/license.js deleted file mode 100644 index 532f39b..0000000 --- a/scripts/license.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * @preserve - * ${name} - v${version} - * Compiled ${date} - * - * ${name} is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */