Project

General

Profile

Bug #22114

foreman webpack vendor asset file can change if plugins are installed

Added by Ohad Levy almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Packaging
Target version:
Difficulty:
Triaged:
Bugzilla link:

Description

Currently, webpack generates two JS bundles, one called bundle and the other is vendor. additional bundles are created per plugin (if the plugin uses webpack).

Webpack is currently configured using the CommonsChunkPlugin to detect if a plugin is using a library (e.g. react), in the case that it detect that both a plugin and core uses the library, it move it into the vendor bundle (to avoid the library to be loaded twice).

This can easily break packaging as the vendor bundle is supplied by the foreman package, and plugin installation can't alter the files delivered by the foreman package.

a solution could be to define the libraries that we move to the vendor file statically, and only those who are defined there can be used by plugins.

other dynamic solutions can also apply - see https://medium.com/@ottoki/adventures-with-webpack-manifest-and-commonschunkplugin-c89631fc87fb for some details.


Related issues

Related to Foreman - Refactor #24590: reduce js library duplication by pluginsClosed

Associated revisions

Revision 3bba4cf1 (diff)
Added by Avi Sharvit almost 3 years ago

Fixes #22114 - Webpack common-chunk vendor.js

Use webpack-common-chunk-plugin to include all
required modules from node_modules/ into vendor.js

History

#1 Updated by Avi Sharvit almost 3 years ago

  • Assignee set to Avi Sharvit

#2 Updated by The Foreman Bot almost 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5145 added

#3 Updated by Walden Raines almost 3 years ago

  • Target version set to 237

#4 Updated by Walden Raines almost 3 years ago

  • Target version changed from 237 to 239

#5 Updated by Avi Sharvit almost 3 years ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#6 Updated by The Foreman Bot almost 3 years ago

  • Pull request https://github.com/theforeman/foreman/pull/5181 added

#7 Updated by Ohad Levy about 2 years ago

  • Related to Refactor #24590: reduce js library duplication by plugins added

Also available in: Atom PDF