Added phaser build and hellophaser sample
This commit is contained in:
3
tasks/options/clean.js
Normal file
3
tasks/options/clean.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
compile_dir: ['<%= compile_dir %>']
|
||||
};
|
||||
53
tasks/options/concat.js
Normal file
53
tasks/options/concat.js
Normal file
@@ -0,0 +1,53 @@
|
||||
module.exports = {
|
||||
|
||||
// Our custom version of p2
|
||||
p2: {
|
||||
src: require('../manifests/p2'),
|
||||
dest: '<%= compile_dir %>/p2.js'
|
||||
},
|
||||
|
||||
// Our custom version of Pixi
|
||||
pixi: {
|
||||
src: require('../manifests/pixi'),
|
||||
dest: '<%= compile_dir %>/pixi.js'
|
||||
},
|
||||
|
||||
// Our custom version of Ninja Physics
|
||||
ninja: {
|
||||
src: require('../manifests/ninja'),
|
||||
dest: '<%= compile_dir %>/ninja.js'
|
||||
},
|
||||
|
||||
// Phaser without Pixi, P2 or Ninja Physics (does include Arcade Physics)
|
||||
phaser: {
|
||||
options: {
|
||||
banner: '<%= banner %>'
|
||||
},
|
||||
src: require('../manifests/phaser'),
|
||||
dest: '<%= compile_dir %>/phaser-no-libs.js'
|
||||
},
|
||||
|
||||
// Phaser with Pixi and Arcade Physics, but no Ninja or P2 libs
|
||||
phaserArcadePhysics: {
|
||||
options: {
|
||||
banner: '<%= banner %>'
|
||||
},
|
||||
src: ['<%= compile_dir %>/pixi.js', '<%= compile_dir %>/phaser-no-libs.js'],
|
||||
dest: '<%= compile_dir %>/phaser-arcade-physics.js'
|
||||
},
|
||||
|
||||
// One ring to rule them all
|
||||
standalone: {
|
||||
options: {
|
||||
banner: '<%= banner %>'
|
||||
},
|
||||
src: [
|
||||
'<%= compile_dir %>/pixi.js',
|
||||
'<%= compile_dir %>/phaser-no-libs.js',
|
||||
'<%= compile_dir %>/ninja.js',
|
||||
'<%= compile_dir %>/p2.js'
|
||||
],
|
||||
dest: '<%= compile_dir %>/phaser.js'
|
||||
}
|
||||
|
||||
};
|
||||
8
tasks/options/connect.js
Normal file
8
tasks/options/connect.js
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = {
|
||||
root: {
|
||||
options: {
|
||||
keepalive: true,
|
||||
hostname: '*'
|
||||
}
|
||||
}
|
||||
};
|
||||
20
tasks/options/copy.js
Normal file
20
tasks/options/copy.js
Normal file
@@ -0,0 +1,20 @@
|
||||
module.exports = {
|
||||
main: {
|
||||
files: [
|
||||
{ src: ['dist/phaser.js'], dest: 'build/phaser.js' },
|
||||
{ src: ['dist/phaser.min.js'], dest: 'build/phaser.min.js' },
|
||||
{ src: ['dist/phaser.map'], dest: 'build/phaser.map' },
|
||||
|
||||
{ src: ['dist/p2.js'], dest: 'build/custom/p2.js' },
|
||||
{ src: ['dist/p2.min.js'], dest: 'build/custom/p2.min.js' },
|
||||
{ src: ['dist/phaser-no-libs.js'], dest: 'build/custom/phaser-no-libs.js' },
|
||||
{ src: ['dist/phaser-no-libs.min.js'], dest: 'build/custom/phaser-no-libs.min.js' },
|
||||
{ src: ['dist/pixi.js'], dest: 'build/custom/pixi.js' },
|
||||
{ src: ['dist/pixi.min.js'], dest: 'build/custom/pixi.min.js' },
|
||||
{ src: ['dist/ninja.js'], dest: 'build/custom/ninja.js' },
|
||||
{ src: ['dist/ninja.min.js'], dest: 'build/custom/ninja.min.js' },
|
||||
{ src: ['dist/phaser-arcade-physics.js'], dest: 'build/custom/phaser-arcade-physics.js' },
|
||||
{ src: ['dist/phaser-arcade-physics.min.js'], dest: 'build/custom/phaser-arcade-physics.min.js' }
|
||||
]
|
||||
}
|
||||
};
|
||||
31
tasks/options/jshint.js
Normal file
31
tasks/options/jshint.js
Normal file
@@ -0,0 +1,31 @@
|
||||
module.exports = {
|
||||
src: {
|
||||
src: [
|
||||
'plugins/**/*.js',
|
||||
'src/**/*.js',
|
||||
'!src/Intro.js',
|
||||
'!src/Outro.js',
|
||||
'!src/pixi/**/*',
|
||||
'!src/physics/p2/p2.js',
|
||||
'!plugins/AStar.js'
|
||||
],
|
||||
options: { jshintrc: '.jshintrc' }
|
||||
},
|
||||
|
||||
filters: {
|
||||
src: ['filters/**/*.js'],
|
||||
options: { jshintrc: 'filters/.jshintrc', }
|
||||
},
|
||||
|
||||
tooling: {
|
||||
src: [
|
||||
'Gruntfile.js',
|
||||
'tasks/**/*.js'
|
||||
],
|
||||
options: { jshintrc: 'tasks/.jshintrc' }
|
||||
},
|
||||
|
||||
options: {
|
||||
force: (process.env.NODE_ENV !== 'test')
|
||||
}
|
||||
};
|
||||
20
tasks/options/replace.js
Normal file
20
tasks/options/replace.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// If we've updated pixi or p2 then their UMD wrappers will be wrong, this will fix it:
|
||||
module.exports = {
|
||||
pixi: {
|
||||
src: ['src/pixi/Outro.js'],
|
||||
dest: 'src/pixi/Outro.js',
|
||||
replacements: [{
|
||||
from: "define(PIXI);",
|
||||
to: "define('PIXI', (function() { return root.PIXI = PIXI; })() );"
|
||||
}]
|
||||
},
|
||||
|
||||
p2: {
|
||||
src: ['src/physics/p2/p2.js'],
|
||||
dest: 'src/physics/p2/p2.js',
|
||||
replacements: [{
|
||||
from: '!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.p2=e():"undefined"!=typeof global?self.p2=e():"undefined"!=typeof self&&(self.p2=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module \'"+o+"\'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){',
|
||||
to: '!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(\'p2\', (function() { return this.p2 = e(); })()):"undefined"!=typeof window?window.p2=e():"undefined"!=typeof global?self.p2=e():"undefined"!=typeof self&&(self.p2=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module \'"+o+"\'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){'
|
||||
}]
|
||||
}
|
||||
};
|
||||
52
tasks/options/uglify.js
Normal file
52
tasks/options/uglify.js
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
module.exports = {
|
||||
p2: {
|
||||
options: {
|
||||
banner: '/* p2.js custom build for Phaser v<%= package.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
|
||||
},
|
||||
src: ['<%= concat.p2.dest %>'],
|
||||
dest: '<%= compile_dir %>/p2.min.js'
|
||||
},
|
||||
|
||||
pixi: {
|
||||
options: {
|
||||
banner: '/* Pixi.js custom build for Phaser v<%= package.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
|
||||
},
|
||||
src: ['<%= concat.pixi.dest %>'],
|
||||
dest: '<%= compile_dir %>/pixi.min.js'
|
||||
},
|
||||
|
||||
ninja: {
|
||||
options: {
|
||||
banner: '/* Ninja Physics for Phaser v<%= package.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
|
||||
},
|
||||
src: ['<%= concat.ninja.dest %>'],
|
||||
dest: '<%= compile_dir %>/ninja.min.js'
|
||||
},
|
||||
|
||||
phaser: {
|
||||
options: {
|
||||
banner: '/* Phaser (no libs) v<%= package.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
|
||||
},
|
||||
src: ['<%= concat.phaser.dest %>'],
|
||||
dest: '<%= compile_dir %>/phaser-no-libs.min.js'
|
||||
},
|
||||
|
||||
phaserArcadePhysics: {
|
||||
options: {
|
||||
banner: '/* Phaser (AP) v<%= package.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
|
||||
},
|
||||
src: ['<%= concat.phaserArcadePhysics.dest %>'],
|
||||
dest: '<%= compile_dir %>/phaser-arcade-physics.min.js'
|
||||
},
|
||||
|
||||
standalone: {
|
||||
options: {
|
||||
sourceMap: true,
|
||||
sourceMapName: '<%= compile_dir %>/phaser.map',
|
||||
banner: '/* Phaser v<%= package.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
|
||||
},
|
||||
src: ['<%= concat.standalone.dest %>'],
|
||||
dest: '<%= compile_dir %>/phaser.min.js'
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user