Skip to content

Manifest includes assets_url in v4.0.0.rc.2 #1845

Closed
@JanStevens

Description

@JanStevens

Hello

In version v4.0.0.rc.2 now generates a manifest.json file that includes the configured asset host

{
  "admin.css": "https://xxxxx.cloudfront.net/packs/admin-e902804e.css",
}

In my production.rb I got

config.action_controller.asset_host = "https://xxxxx.cloudfront.net"

And my environment.js has

const splitChunks = {
  optimization: {
    runtimeChunk: false,
    splitChunks: {
      chunks: 'all'
    }
  }
}

environment.config.merge(splitChunks)

environment.plugins.insert(
  'Manifest',
  new WebpackAssetsManifest({
    integrity: false,
    entrypoints: true,
    writeToDisk: true,
    publicPath: true
  })
)

In version v4.0.0.pre.3 the same settings would generate the manifest as followed:

{
  "admin.css": "/packs/admin-e902804e.css",
}

I do want to turn this off, since I do not know during compilation of my assets the cloudfront url and my devops team might want to change the cloudfront url. This would now mean we have to recompile assets again.

We compile assets and upload them to S3 using

 env RAILS_ENV=production env NODE_ENV=production bundle exec rake webpacker:compile   

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions