Search code examples
ckeditorcomposer-phptypo3typo3-8.x

In TYPO3 8.7, require a non-extension package in custom extension's composer.json


I want to require a package for rte_ckeditor within a custom local TYPO3 extension. I see that I should be able to use installer-paths but noticed that the #typo3-cms-composer Slack channel mentioned that it doesn't play well with TYPO3.

Here's what I want to do in my extension's composer.json file but it seems to be ignored when I run composer install:

"require": {
  "w8tcha/ckeditor-wordcount-plugin": "~1.17"
},
"extra": {
  "installer-paths": {
    "./Resources/Public/RTE/Wordcount/": [
      "w8tcha/ckeditor-wordcount-plugin"
    ]
  }
}

Solution

  • The installer-paths option belongs to the composer/installers package. However, you cannot use this package since it conflicts with typo3/cms-composer-installers.

    Even though there is a Composer package for the CKEditor wordcount plugin you should install ckeditor-wordcount-plugin via NPM instead. Depending on your build tools you can then copy that package to your desired location, e.g. via Grunt and grunt-npmcopy.