Skip to content

Commit

Permalink
Merge pull request #1919 from karelhala/webpackerNamespace
Browse files Browse the repository at this point in the history
Change webpacker to store plugin javascript in corespoding folder
  • Loading branch information
himdel committed Aug 15, 2017
2 parents f06130f + 05003f3 commit 353f0d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.haml
Expand Up @@ -32,7 +32,7 @@
= csrf_meta_tag
= render :partial => 'layouts/i18n_js'
-# FIXME: the conditional below is a temporary fix for a webpacker issue, remove when it's resolved
= javascript_pack_tag 'application' unless Rails.env.test?
= javascript_pack_tag 'manageiq-ui-classic/application' unless Rails.env.test?
:javascript
ManageIQ.charts.provider = "#{Charting.backend}";
Expand Down
7 changes: 3 additions & 4 deletions config/webpack/shared.js
Expand Up @@ -26,10 +26,9 @@ Object.keys(engines).forEach(function(k) {
module.exports = {
entry: packPaths.reduce(
(map, entry) => {
const localMap = map
const namespace = relative(join(entryPath), dirname(entry))
localMap[join(namespace, basename(entry, extname(entry)))] = resolve(entry)
return localMap
const pluginName = dirname(entry).substring(0, dirname(entry).length - join(entryPath).length)
map[join(basename(pluginName), basename(entry, extname(entry)))] = resolve(entry)
return map
}, {}
),

Expand Down

0 comments on commit 353f0d3

Please sign in to comment.