mirror of
https://github.com/photonstorm/phaser
synced 2024-11-21 20:23:19 +00:00
Remove old gruntfile
This commit is contained in:
parent
94c7c57e1c
commit
7b052c302f
1 changed files with 0 additions and 80 deletions
80
GruntFile.js
80
GruntFile.js
|
@ -1,80 +0,0 @@
|
|||
module.exports = function (grunt) {
|
||||
grunt.loadNpmTasks('grunt-typescript');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
|
||||
var wrapPhaserInUmd = function(content, isAddon) {
|
||||
var replacement = [
|
||||
'(function (root, factory) {',
|
||||
' if (typeof exports === \'object\') {',
|
||||
' module.exports = factory();',
|
||||
' } else if (typeof define === \'function\' && define.amd) {',
|
||||
' define(factory);',
|
||||
' } else {',
|
||||
' root.Phaser = factory();',
|
||||
' }',
|
||||
'}(this, function () {',
|
||||
content,
|
||||
'return Phaser;',
|
||||
'}));'
|
||||
];
|
||||
return replacement.join('\n');
|
||||
};
|
||||
|
||||
var wrapAddonInUmd = function(content) {
|
||||
var replacement = [
|
||||
'(function (root, factory) {',
|
||||
' if (typeof exports === \'object\') {',
|
||||
' module.exports = factory(require(\'phaser\'));',
|
||||
' } else if (typeof define === \'function\' && define.amd) {',
|
||||
' define([\'phaser\'], factory);',
|
||||
' } else {',
|
||||
' factory(root.Phaser);',
|
||||
' }',
|
||||
'}(this, function (Phaser) {',
|
||||
content,
|
||||
'return Phaser;',
|
||||
'}));'
|
||||
];
|
||||
return replacement.join('\n');
|
||||
};
|
||||
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
typescript: {
|
||||
base: {
|
||||
src: ['Phaser/**/*.ts'],
|
||||
dest: 'build/phaser.js',
|
||||
options: {
|
||||
target: 'ES5',
|
||||
declaration: true,
|
||||
comments: true
|
||||
}
|
||||
},
|
||||
},
|
||||
copy: {
|
||||
main: {
|
||||
files: [{
|
||||
src: 'build/phaser.js',
|
||||
dest: 'Tests/phaser.js'
|
||||
}]
|
||||
},
|
||||
mainAmd: {
|
||||
files: [{
|
||||
src: 'build/phaser.js',
|
||||
dest: 'build/phaser.amd.js'
|
||||
}],
|
||||
options: {
|
||||
processContent: wrapPhaserInUmd
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
files: '**/*.ts',
|
||||
tasks: ['typescript', 'copy']
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('default', ['typescript', 'copy', 'watch']);
|
||||
|
||||
}
|
Loading…
Reference in a new issue