Webpacker Basics
Webpacker is a wrapper around webpack, designed to make webpack easier to manage within a Rails application.[65] The main thing Webpacker does is generate a webpack configuration using a set of inputs that is hopefully simpler to deal with than a full webpack configuration. It uses a YAML file, config/webpacker.yml, to specify a lot of webpack values, and specific environment overrides are in the config/webpack directory.
That basic configuration gives you the following features:
-
Any file in app/packs/entrypoints with a known extension (usually a JavaScript or CSS extension) is the entry point of a new pack. The name of the pack is the base name of the file. If there are multiple files with the same base name but different extensions, ...