Plugin/RequireJs.php
public function afterGetFiles(RequireJsCollector $subject, array $files)
    {
        $magentoVersion = $this->productMetadata->getVersion();

        if (version_compare($magentoVersion, '2.2.0', '>=')) {

            foreach ($files as $index => $file) {

                if ($file->getModule() === 'Bolt_Boltpay') {
                    unset($files[$index]);
                }
            }
        }
        return $files;
    }
public function afterGetFiles(RequireJsCollector $subject, array $files)
    {
        $magentoVersion = $this->productMetadata->getVersion();

        if (version_compare($magentoVersion, '2.2.0', '>=')) {

            foreach ($files as $index => $file) {

                if ($file->getModule() === 'Bolt_Boltpay') {
                    unset($files[$index]);
                }
            }
        }
        return $files;
    }
public function afterGetFiles ( RequireJsCollector $ subject , array $ files ) { $ magentoVersion = $ this -> productMetadata -> getVersion ( ) ; if ( version_compare ( $ magentoVersion , '2.2.0' , '>=' ) ) { foreach ( $ files as $ index => $ file ) { if ( $ file -> getModule ( ) === 'Bolt_Boltpay' ) { unset ( $ files [ $ index ] ) ; } } } return $ files ; }
After requireJs files are collected remove the ones added by Bolt
for the store version greater than or equal to 2.2.0.

@param RequireJsCollector $subject
@param array $files
@return array
After requireJs files are collected remove the ones added by Bolt for the store version greater than or equal to 2 . 2 . 0 .