Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Commit

Permalink
Updating grunt-ts + adding dist build
Browse files Browse the repository at this point in the history
  • Loading branch information
cloakedninjas committed Jul 7, 2018
1 parent 6757b4a commit e9f553a
Show file tree
Hide file tree
Showing 3 changed files with 2,371 additions and 64 deletions.
162 changes: 101 additions & 61 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,69 +1,109 @@
module.exports = function (grunt) {
grunt.initConfig({
ts: {
dev: {
src: ['src/scripts/**/*.ts'],
dest: 'public/js',
options: {
module: 'amd', //or commonjs
target: 'es5', //or es3
sourceMap: false,
declaration: false
}
}
},
grunt.initConfig({
ts: {
dev: {
src: ['src/scripts/**/*.ts'],
dest: 'public/js',
options: {
module: 'amd', //or commonjs
target: 'es5', //or es3
sourceMap: false,
declaration: false
}
},
prod: {
src: ['src/scripts/**/*.ts'],
reference: "src/refs.d.ts",
out: 'public/game.min.js',
options: {
sourceMap: false
}
}
},

copy: {
dev: {
files: [
{
expand: true,
cwd: 'src',
src: [
'assets/**'
],
dest: 'public/'
},
{
src: 'src/index.html',
dest: 'public/index.html'
},
{
src: 'node_modules/phaser/build/custom/phaser-no-physics.js',
dest: 'public/vendor/phaser/phaser.js'
},
{
src: 'node_modules/phaser-ce/build/custom/phaser-no-physics.js',
dest: 'public/vendor/phaser/phaser.js'
}
]
}
},
copy: {
dev: {
files: [
{
expand: true,
cwd: 'src',
src: [
'assets/**'
],
dest: 'public/'
},
{
src: 'src/index.html',
dest: 'public/index.html'
},
{
src: 'node_modules/phaser-ce/build/custom/phaser-no-physics.js',
dest: 'public/vendor/phaser/phaser.js'
}
]
},
prod: {
files: [
{
expand: true,
cwd: 'src',
src: [
'assets/**'
],
dest: 'public/'
},
{
src: 'src/index-dist.html',
dest: 'public/index.html'
},
{
src: 'node_modules/phaser-ce/build/custom/phaser-no-physics.js',
dest: 'public/vendor/phaser/phaser.js'
}
]
}
},

clean: {
dev: ['public/**/*']
},
clean: {
dev: ['public/**/*']
},

watch: {
scripts: {
files: ['src/**/*'],
tasks: ['dev'],
options: {
spawn: false,
debounceDelay: 250
}
}
watch: {
scripts: {
files: ['src/**/*'],
tasks: ['dev'],
options: {
spawn: false,
debounceDelay: 250
}
});
}
},

uglify: {
prod: {
files: {
'public/game.min.js': ['public/game.min.js']
}
}
}
});

grunt.loadNpmTasks('grunt-ts');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.loadNpmTasks('grunt-ts');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('dev', [
'clean:dev',
'ts:dev',
'copy:dev'
]);

grunt.registerTask('dev', [
'clean:dev',
'ts:dev',
'copy:dev'
]);
grunt.registerTask('prod', [
'clean:dev',
'ts:prod',
'copy:prod',
'uglify:prod'
]);
};
Loading

0 comments on commit e9f553a

Please sign in to comment.