Skip to content

How to change output filename of runtime chunk? #5358

Closed

Description

@march08

currently the output is runtime~xxx.[hash].js

How do I change that? I can't make it work on cloudfront to serve files with ~ in the filename...

Example:
S3: https://s3.eu-central-1.amazonaws.com/timesheet-app.topmonks.com/static/js/runtime~main.229c360f.js Works
CF: https://timesheet-app.topmonks.com/static/js/runtime~main.229c360f.js doesn't work

Thanks a lot

Edit:
Proposed changes:

webpack.prod InlineChunkHtmlPlugin

new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/runtime-.+[.]js/])

webpack.prod runtimeChunk

runtimeChunk: { 
    name: entrypoint => `runtime-${entrypoint.name}`,
},

Edit: seems like the cloudfront link somehow works now, anyway I would perform the change anyway as imo ~ is not the best idea for file naming.

Activity

  1. Timer commented on Oct 8, 2018

    @Timer
    Contributor

    This is probably a bad default name, we should replace the ~ with something else.

  2. added this to the 2.0.x milestone on Oct 8, 2018
  3. march08 commented on Oct 8, 2018

    @march08
    Author

    This is probably a bad default name, we should replace the ~ with something else.

    Mm ok, just found it here if there is anyone with the same situation.

    I assume that without ejecting, I can do nothing here?

  4. Timer commented on Oct 8, 2018

    @Timer
    Contributor

    If your app isn't embedded in a larger app, you shouldn't need this file for your app to function. Just delete it. 😄

  5. march08 commented on Oct 8, 2018

    @march08
    Author

    You shouldn't need this file for your app to function. Just delete it. 😄

    I would have to delete all the references from the build folder.
    At this moment I receive mixes content (http(s)) and the serviceWorker is not up...

  6. yordis commented on Oct 11, 2018

    @yordis

    I think we should replace it with - instead of ~.

    @Timer we are embedded 😢

  7. modified the milestones: 2.1.x, 3.0 on Nov 8, 2018
  8. pjoe commented on Jan 25, 2019

    @pjoe

    Having the same issue. Who came up with putting ~ in the file name 😮

    Filenames should only contain 1 and 0 😛

  9. modified the milestones: 3.0, 3.x on Mar 10, 2019
  10. adamplabarge commented on Apr 19, 2019

    @adamplabarge

    +1 for changing the ~ to something else. . -_ would all be better options.

  11. iansu commented on Apr 19, 2019

    @iansu
    Contributor

    This is not something we're doing in our webpack config. These are the default names that webpack uses for chunks. I'm not sure that we can easily change them. You might want to file an issue with webpack and then link to it here.

  12. march08 commented on Apr 29, 2019

    @march08
    Author

    This is not something we're doing in our webpack config. These are the default names that webpack uses for chunks. I'm not sure that we can easily change them. You might want to file an issue with webpack and then link to it here.

    I've attached links to files where the problem is in the webpack configuration

  13. javadoug commented on Sep 13, 2019

    @javadoug

    My company has a firewall rule that rejects any url with ~ in it. I need this fix (would not want to eject) for this issue.

    Per Webpack #runtimeChunk documentation the config change is easily done as noted by op.

    PR provided #7679

    If this fix is already provided elsewhere I will gladly close.

  14. removed this from the 3.x milestone on Sep 13, 2019
  15. locked and limited conversation to collaborators on Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions