Skip to content

Commit

Permalink
[TASK] Avoid double-terse in incremental builds via grunt scripts
Browse files Browse the repository at this point in the history
Ensure `grunt build` generates a timestamp in
Build/.cache/grunt-newer/terser/typescript/timestamp
by using `newer:terser:typescript` instead of `terser:typescript`.

This is for `grunt newer:terser:typescript`
(as executed by `grunt scripts`) to able to pick this
timestamp in subsequent builds to avoid re-tersing
files that have already been tersed in a previous full-run
(grunt build).

Background:
With the changes in #95016, `grunt terser:typescript`
became a static task that executed terser for all
typescript files in Build/JavaScript/.
Prior to that change the list of files to be
tersed was dynamically configured only for
changed files in `grunt copy:ts_files`.
Now, that means
`grunt newer:copy:ts_files terser:typescript` was equal to
`grunt newer:copy:ts_files newer:terser:typescript`.

That changed with #95015 because `grunt build` creates a cache
for incremental builds of tsc but not for newer:terser.

Note: Using newer: during `grunt build` has no impact on
which files are processed as `grunt build` cleans all cache
files upfront and therefore `newer:terser:typescript` will terse all
files in that context and only creates the timestamp additionally.

Releases: master
Resolves: #95341
Related: #95016
Change-Id: I90b74198f8982012935d86db94f8e1e71fedc548
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71226
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benni Mack <benni@typo3.org>
  • Loading branch information
bnf authored and bmack committed Sep 24, 2021
1 parent f17ea51 commit 6e6b4ee
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Build/Gruntfile.js
Expand Up @@ -760,7 +760,7 @@ module.exports = function (grunt) {
concurrent: {
npmcopy: ['npmcopy:ckeditor', 'npmcopy:ckeditor_externalplugins', 'npmcopy:dashboard', 'npmcopy:all'],
lint: ['eslint', 'stylelint', 'lintspaces'],
compile_assets: ['build-scripts', 'build-css'],
compile_assets: ['scripts', 'css'],
minify_assets: ['terser:thirdparty', 'terser:t3editor'],
copy_static: ['copy:core_icons', 'copy:install_icons', 'copy:module_icons', 'copy:extension_icons', 'copy:fonts', 'copy:t3editor'],
build: ['copy:core_icons', 'copy:install_icons', 'copy:module_icons', 'copy:extension_icons', 'copy:fonts', 'copy:t3editor'],
Expand Down Expand Up @@ -901,8 +901,4 @@ module.exports = function (grunt) {
* - compiles TypeScript files
*/
grunt.registerTask('build', ['clear-build', 'update', 'concurrent:copy_static', 'concurrent:compile_assets', 'concurrent:minify_assets', 'imagemin']);

// Internal build tasks
grunt.registerTask('build-scripts', ['compile-typescript', 'terser:typescript', 'copy:ts_files'])
grunt.registerTask('build-css', ['formatsass', 'sass', 'postcss']);
};

0 comments on commit 6e6b4ee

Please sign in to comment.