TypoScript 

Changed in version 13.1

TypoScript constants should be stored in the file constants.typoscript and TypoScript setup in setup.typoscript.

Configuration/TypoScript/constants.typoscript

constants.typoscript
Scope
extension
Path (Composer)
packages/my_extension/Configuration/TypoScript/constants.typoscript
Path (Classic)
typo3conf/ext/my_extension/Configuration/TypoScript/constants.typoscript

Configuration/TypoScript/setup.typoscript

setup.typoscript
Scope
extension
Path (Composer)
packages/my_extension/Configuration/TypoScript/setup.typoscript
Path (Classic)
typo3conf/ext/my_extension/Configuration/TypoScript/setup.typoscript

These two files are made available for inclusion in TypoScript records by ExtensionManagementUtility::addStaticFile in Configuration/TCA/Overrides/sys_template.php:

EXT:my_extension/Configuration/TCA/Overrides/sys_template.php
<?php

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

ExtensionManagementUtility::addStaticFile(
    'my_extension',
    'Configuration/TypoScript/',
    'Examples TypoScript',
);
Copied!

It is possible to use subfolders or a differently named folder instead, however, the file names have to stay the same.