ekohl
October 21, 2021, 12:10pm
1
In packaging we had a case that I think we haven’t run into before: a plugin with webpack-only assets. AFAIK all other plugins either have no assets or have at least some sprockets assets.
For background, read my comment here:
theforeman:rpm/develop
← lzap:rpm/develop-fhr003
It's generated by the assets pipeline:
https://github.com/theforeman/foreman-pa… ckaging/blob/87399bad27520349e552625a18b814554431ca4a/packages/foreman/foreman/foreman.spec#L884-L923
In particular the rake task `plugin:assets:precompile`:
https://github.com/theforeman/foreman-packaging/blob/87399bad27520349e552625a18b814554431ca4a/packages/foreman/foreman/foreman.spec#L910
That it's run with `-s` is determined here in the template:
https://github.com/theforeman/foreman-packaging/blob/87399bad27520349e552625a18b814554431ca4a/gem2rpm/foreman_plugin.spec.erb#L28
It then in the files section has:
https://github.com/theforeman/foreman-packaging/blob/87399bad27520349e552625a18b814554431ca4a/gem2rpm/foreman_plugin.spec.erb#L193-L195
So you can add `%exclude %{foreman_assets_plugin}` in files to ignore it.
Looking at the source (https://github.com/theforeman/foreman/blob/develop/lib/tasks/plugin_assets.rake) it runs sprockets unconditionally. This may be the first plugin that has assets but not using sprockets. Perhaps that needs something conditional.
My question is now: can we correctly detect sprockets shouldn’t run at all? Would that break anything?