Refs #37102 - detect plugins webpack by looking for remoteEntry.js#10025
Refs #37102 - detect plugins webpack by looking for remoteEntry.js#10025evgeni merged 1 commit intotheforeman:developfrom
Conversation
|
For devel setups and Debian this works by checking |
062c2fe to
43ee257
Compare
|
|
||
| def uses_webpack? | ||
| path && (File.file?(File.join(path, 'webpack', 'index.js')) || webpack_manifest_path.present?) | ||
| path && (File.file?(File.join(path, 'webpack', 'index.js')) || webpack_manifest_path.present? || webpack_remote_entry.present?) |
There was a problem hiding this comment.
arguably, webpack_manifest_path.present? can be dropped now
also, this method hits the disk on every page load, we should cache the result in memory (but scope creep!)
There was a problem hiding this comment.
Which is exactly what I aimed at in #9834 (comment) but I should have pushed further on this.
There was a problem hiding this comment.
you mean "hits the disk" part?
|
With this applied I get working Katello prod installs with Webpack 5 \o/ |
|
|
||
| def uses_webpack? | ||
| path && (File.file?(File.join(path, 'webpack', 'index.js')) || webpack_manifest_path.present?) | ||
| path && (File.file?(File.join(path, 'webpack', 'index.js')) || webpack_manifest_path.present? || webpack_remote_entry.present?) |
There was a problem hiding this comment.
When is path && (File.file?(File.join(path, 'webpack', 'index.js')) false? I only see it as true all the time
There was a problem hiding this comment.
when we use RPMs as we do not ship the webpack folder at all there, as we do not need to compile anything from it on the system where we deploy.
| end | ||
|
|
||
| def webpack_remote_entry | ||
| remote_entry_path = File.join(path, 'public', 'webpack', id.to_s, "#{id}_remoteEntry.js") |
There was a problem hiding this comment.
probably should do the - -> _ change for tasks here
43ee257 to
d3324ea
Compare
Since we switched to Webpack 5, there are no more manifest.json in the plugins webpack folder, but we need some token to detect that we gotta load webpack stuff.
d3324ea to
27871fb
Compare
|
[test unit] seems unrelated |
Since we switched to Webpack 5, there are no more manifest.json in the plugins webpack folder, but we need some token to detect that we gotta load webpack stuff.