From a73850897fbb8ef0f2560f15d0eb867bcbad3ae0 Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Sun, 3 Apr 2016 19:55:24 -0700 Subject: [PATCH] Add dist command to build process --- Gruntfile.coffee | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 83292fc3d..b15e45c6c 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -30,6 +30,7 @@ module.exports = (grunt)-> {expand: true, cwd:'./build/static', src:'**/*.html', dest:'./dist/'} {expand: true, cwd:'./build/static', src:'**/*.js', dest:'./dist/'} {expand: true, cwd:'./build/static', src:'**/*.json', dest:'./dist/'} + {expand: true, cwd:'./build/static', src:'**/*.ttf', dest:'./dist/'} ] coffee: @@ -39,22 +40,21 @@ module.exports = (grunt)-> files: [expand:true, cwd:'./src/coffee', src:'**/*.coffee', dest:'./dist', ext:'.js'] copy: - server_source: + assets_build: files: [ - {expand:true, cwd:'./src/server', src:'**/*.coffee', dest:'./build/', ext:'.coffee'} + {expand:true, cwd:'./assets/', src:'**/*', dest:'./build/static/'} + ] + build_to_dist: + files: [ + {expand:true, cwd:'./build/static/', src:['**/*', '!**/*.map'], dest:'./dist/'} ] common_source: files: [ {expand:true, cwd:'./src/common', src:'**/*.coffee', dest:'./build/', ext:'.coffee'} ] - assets_build: + server_source: files: [ - {expand:true, cwd:'./assets/', src:'**/*', dest:'./build/static/'} - ] - assets_dist: - files: [ - {expand:true, cwd:'./assets/', src:'**/*.mp3', dest:'./dist/'} - {expand:true, cwd:'./assets/', src:'**/*.png', dest:'./dist/'} + {expand:true, cwd:'./src/server', src:'**/*.coffee', dest:'./build/', ext:'.coffee'} ] clean: @@ -123,7 +123,7 @@ module.exports = (grunt)-> expand: true cwd: './build/static' src: '**/*.js' - dest: './build/static' + dest: './dist' ] watch: @@ -151,15 +151,19 @@ module.exports = (grunt)-> # Compound Tasks ################################################################################################### - grunt.registerTask 'build', ['jade', 'copy', 'css', 'browserify:external', 'browserify:internal'] + grunt.registerTask 'build', ['jade', 'build:copy', 'css', 'browserify:external', 'browserify:internal'] + + grunt.registerTask 'build:copy', ['copy:assets_build', 'copy:common_source', 'copy:server_source'] grunt.registerTask 'css', ['sass_globbing', 'sass'] grunt.registerTask 'default', ['clean', 'start'] - grunt.registerTask 'deploy:prod', ['build', 'uglify', 'compress', 'copy:assets_dist', 'script:deploy:prod'] + grunt.registerTask 'deploy:prod', ['dist', 'script:deploy:prod'] - grunt.registerTask 'deploy:staging', ['build', 'uglify', 'compress', 'copy:assets_dist', 'script:deploy:staging'] + grunt.registerTask 'deploy:staging', ['dist', 'script:deploy:staging'] + + grunt.registerTask 'dist', ['build', 'uglify', 'copy:build_to_dist', 'compress'] grunt.registerTask 'prepublish', ['clean', 'coffee']