Skip to content

Commit 665f9f3

Browse files
kevinansfieldkirrg001
authored andcommitted
🎨 Don't include Ghost-Admin development assets in release builds
closes TryGhost#6149 - speeds up and reduces size of releases by not building and including the development versions of Ghost-Admin - ensures the server can still be run in both production and development by copying the admin `default-prod.html` file to `default.html` as part of the release task - development builds aren't useful in release zips (especially when the sourcemaps are stripped from releases) - if deep debugging or changes are to be made in Ghost-Admin then it should be checked out from git (see https://docs.ghost.org/docs/working-with-the-admin-client)
1 parent 0b4904c commit 665f9f3

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎Gruntfile.js‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,8 @@ var overrides = require('./core/server/overrides'),
729729
// ### Release
730730
// Run `grunt release` to create a Ghost release zip file.
731731
// Uses the files specified by `.npmignore` to know what should and should not be included.
732-
// Runs the asset generation tasks for both development and production so that the release can be used in
733-
// either environment, and packages all the files up into a zip.
732+
// Runs the asset generation tasks for production and duplicates default-prod.html to default.html
733+
// so it can be run in either production or development, and packages all the files up into a zip.
734734
grunt.registerTask('release',
735735
'Release task - creates a final built zip\n' +
736736
' - Do our standard build steps \n' +
@@ -750,7 +750,14 @@ var overrides = require('./core/server/overrides'),
750750
dest: '<%= paths.releaseBuild %>/'
751751
});
752752

753-
grunt.task.run(['init', 'prod', 'clean:release', 'copy:release', 'compress:release']);
753+
grunt.config.set('copy.admin_html', {
754+
files: [{
755+
src: '<%= paths.releaseBuild %>/core/server/admin/views/default-prod.html',
756+
dest: '<%= paths.releaseBuild %>/core/server/admin/views/default.html'
757+
}]
758+
});
759+
760+
grunt.task.run(['update_submodules:pinned', 'subgrunt:init', 'clean:tmp', 'prod', 'clean:release', 'copy:release', 'copy:admin_html', 'compress:release']);
754761
}
755762
);
756763
};

0 commit comments

Comments
 (0)