Skip to content

Commit

Permalink
Change webpacker to store plugin javascript in corespoding folder,
Browse files Browse the repository at this point in the history
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
  • Loading branch information
karelhala committed Aug 15, 2017
1 parent d052bb0 commit cad5591
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config/webpack/shared.js
Expand Up @@ -26,10 +26,10 @@ 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)
const prefix = basename(entry, extname(entry)) === 'application' ? '' : basename(pluginName) + '/'
map[prefix + basename(entry, extname(entry))] = resolve(entry)
return map
}, {}
),

Expand Down

0 comments on commit cad5591

Please sign in to comment.