Disable webpack assets in RPM package

Hello.
I have developed a simple plugin from a plugin template repo. It utilizes Rails views. No webpack/js was modified.
I’ve set up a separate VM for rpm package builds. It only has foreman-assets / foreman-plugin / rubygems-devel packages installed. I can build the package just fine with rpmbuild -ba /path/to/my_specfile.spec. The built package contains both public/assets & public/webpack directories. Thanks to those who documented all of these steps.
However, I want to build an RPM package and disable generation of webpack assets since I don’t need them for my plugin to work. How can I achieve that?
( I am assuming that when rake plugin:assets:precompile[gem_name] task is run, it will still attempt to build the webpack and it can be disabled via rails config. But I cannot access rails config from build VM )
Should I use an %exclude macro in %files section of the specfile?
Or should I disable the generation of webpack assets within a build process somehow?
Any suggestion is appreciated.

How does your spec file look like? Does it use our template?

Is there a call to %foreman_precompile_plugin macro? If you don’t need to call plugin:assets:precompile, you don’t need to call that macro.

1 Like

Thank you for the reply. I used specfile from some other plugin (one of foreman-tasks or foreman-ansible). So yes - it does contain foreman_precompile_plugin macro.
I figured this out - the assumption that running rake plugin:assets:precompile[gem_name] would still attempt to build webpack assets was wrong. All I had to do is to remove the webpack directory.