Commit 6e6b4ee4 authored by Benjamin Franzke's avatar Benjamin Franzke Committed by Benni Mack
Browse files

[TASK] Avoid double-terse in incremental builds via `grunt scripts`

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's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent f17ea510
......@@ -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'],
......@@ -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']);
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment