New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change webpacker to store plugin javascript in corespoding folder #1919
Conversation
when webpacker loads files it will store them in plugin's folder in public/packs folder. application chunk name is exception and HAS to stay in parent folder
effb6ac
to
cad5591
Compare
Checked commits karelhala/manageiq-ui-classic@cad5591~...05003f3 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
LGTM 👍 pretty much just waiting for feedback if any, and travis :) |
@himdel ok thanks! |
@himdel @karelhala This breaks when installed as a This passed when you tested this locally, it most likely was with you using I am partially bringing this up because this is the second time in the past week where this has happened (bug passed in local testing, but failed in the "git gem" scenario). Can we look at ways of somehow testing this in it's git gem form prior to merging? This will most likely happen again in the future, and it would be nice if it was preventable before affecting others (currently breaking appliance/docker builds based off of master). |
My above comment should be addressed in #1925 |
when webpacker loads files it will store them in plugin's folder in public/packs folder.
Before
Folder structure of public packs was
Usage in haml file:
After
Folder structure of public packs
Usage in haml file:
Fixes plugin's javascripts
If we were to add another plugin with
app/javascript/packs/example.js
the chunk name was broken../../plugin_example/app/javascript/packs/example
, this file was later on not accessible and threw 404. This PR changes it that any JS packs will be copied over to parent manageIq corepublic/packs
folder and will be placed within folder of plugin's name. (for example)Usage of such JS is (can be used across whole MiQ app, not just in plugin):
+= javascript_pack_tag 'plugin_example/example'