question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

production build: change name

See original GitHub issue

Is this a bug report?

No. Just a question

Question

Is het possible to change the production build .js name?

npm run build is now generating a file with a name like :

runtime~main.fdfcfda2.js (using react-scripts 2.1.5)

The issue I am having is that when I deploy to an SAP server it is failing because the special character '~` in the file is not allowed.

I think it is more a SAP problem but maybe it is simple to change the generated name (without ejecting ofcourse)

btw: is it important to have this special character in the name?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
robb1ssellcommented, May 8, 2019

https://github.com/webpack/webpack/issues/6710

Seems like webpack just started it that way, but when questioned about it, didn’t really push back that there was a reason for it. They added the ability to change it in a release soon after.

Would changing it in the default CRA config have any adverse effects? I can’t think of any.

1reaction
petetntcommented, Mar 10, 2019

I think the changes required for this would be changing this:

https://github.com/facebook/create-react-app/blob/1548a0a92e41f9f626aa2c5226fb1a2cb2ec9229/packages/react-scripts/config/webpack.config.js#L254

to

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

and

https://github.com/facebook/create-react-app/blob/1548a0a92e41f9f626aa2c5226fb1a2cb2ec9229/packages/react-scripts/config/webpack.config.js#L549

to

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

Not sure if the special character there is for some special reason, probably not. Would you like to submit a PR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

create-react-app production build renames functions
I have created a class (ActionIndex) that imports and indexes an initial set of functions in a separate file (actions.ts) so they can...
Read more >
Creating a Production Build - Create React App
npm run build creates a build directory with a production build of your app ... This hash in the file name enables long...
Read more >
Reactjs Build Production: Optimize Performance - CopyCat Blog
Notice that for files within the build/static folder, a unique hash is appended to the file name. This hash code is generated based...
Read more >
API - ESBuild
There are two main API calls in esbuild's API: transform and build. ... JSX fragment; JSX import source; JSX side effects; Keep names;...
Read more >
Prepare and roll out a release - Play Console Help
Production : Production releases are available to all Google Play users in your ... in Play Console only, such as an internal code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found