Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Support for multiple chunks #79

@ketan

Description

@ketan

It looks like this gem breaks when using multiple chunks.

The fix seems to be to change Webpack::Rails::Manifest.asset_paths to the following implenentation —

        def asset_paths(source)
          raise WebpackError, manifest["errors"] unless manifest_bundled?

          if manifest["entrypoints"][source] && paths = manifest["entrypoints"][source]['assets']
            # # Can be either a string or an array of strings.
            # # Do not include source maps as they are not javascript
            [paths].flatten.reject { |p| p =~ /.*\.map$/ }.map do |p|
              "/#{::Rails.configuration.webpack.public_path}/#{p}"
            end
          else
            raise EntryPointMissingError, "Can't find entry point '#{source}' in webpack manifest"
          end

        end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions