#79737Registered pageTSconfig file won't allow relative paths for include
Description
As described in the documentation ([[https://docs.typo3.org/typo3cms/TyposcriptSyntaxReference/Syntax/Includes/]]) you can use relative paths to include a file or a bunch of files inside a folder.
This works as expected as long as you include your TSconfig as default TSconfig by calling \ExtensionManagementUtility::addPageTSConfig() in your ext_localconf.php.
If you register your TSconfig for possible includes by calling ExtensionManagementUtility::registerPageTSConfigFile() in your /Configuration/TCA/Overrides/pages.php, relative paths for file/directory include do not work.
Example code:
# FILE: /Configuration/TSconfig/Page.ts <INCLUDE_TYPOSCRIPT: source="FILE:./RTE.ts">
# FILE: /Configuration/TSconfig/RTE.ts RTE >
Include of RTE.ts with relative path works:
// FILE: ext_localconf.php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:foo/Configuration/TSconfig/Page.ts">'
);
Include of RTE.ts with relative path doesn’t work:
// FILE: /Configuration/TCA/Overrides/pages.php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
'foo',
'Configuration/TSconfig/Page.ts',
'foo - PageTS'
);
To make the include work for registered TSconfig you have to use one of these:
# FILE: /Configuration/TSconfig/Page.ts <INCLUDE_TYPOSCRIPT: source="FILE:EXT:foo/Configuration/TSconfig/RTE.ts"> # OR: <INCLUDE_TYPOSCRIPT: source="FILE:typo3conf/ext/foo/Configuration/TSconfig/RTE.ts">
All these examples also apply for relative paths to directories (DIR:./BackendLayouts/ extension=“ts”).
Reviews 5
- 12.4 84036[BUGFIX] Correctly resolve relative imports in page.tsconfig
- main 83712[BUGFIX] Correctly resolve relative imports in page.tsconfig
- 12.4 84340[TASK] Utilize PackageDependentCacheIdentifier in TsConfigTreeBuilder
- main 84279[TASK] Utilize PackageDependentCacheIdentifier in TsConfigTreeBuilder
- main 72737[BUGFIX] Allow import of relative paths in PageTsConfig