AssetBundle: how can I add files from different paths?

I’m using a extension which includes several .js and .css files. I have put all that files together in an AssetBundle.

Problem is, I have customized some .js files. The overridden files are in a custom directory while the extension is placed, as usual, in the vendor folder.

Is there any way to include, in a single AssetBundle, both the extension directory and my custom directory.

All what I found about it is the issue #12017.

I even thought about to use the project root folder as $sourcePath and then to reach the correct directories by configuring the $publishOptions property with ‘only’. But, despite the performance hit, it is not possible to use the project root folder as $sourcePath because it (obviously) contains the web/assets folder and Yii raises a ‘Trying to copy a directory to itself or a subdirectory’ exception (even if I include the web directory in option ‘except’).

Anybody any ideas?

I was stubborn trying to make a single AssetBundle. I think that, if it is possible, is going to be in a hacky way (please, correct me if I am wrong).

Instead I created two: one for the extension an other for the custom files. The second one depends on the first one, so I just need to register the second one on my views and the maintenance is easy.

If someone it is interested in the topic (specially for i18n support), despite the aforementioned issue (#12017), the #728 is a good source. Actually, the example code in the #728 was part of the docs until the commit 4d6ebae.