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.

How do I build js and css without random number?

See original GitHub issue

Is there a way I can build production css and js file without the random generated number at the file?

For example, every time I build I get something like this main.a31171f1.css and main.a31171f1.js. I need this because I want to be able to fix that in my index.html.

Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

34reactions
tbillingtoncommented, Nov 4, 2016

@noppanit Just for posterity, my build looks like this

"build": "react-scripts build && npm run build:clean",
"build:clean": "cd build && mv static/js/*.js main.js && mv static/css/*.css main.css && rm -r static",
4reactions
gaearoncommented, Mar 6, 2017

When you run build, a file called asset-manifest.json (if I recall correctly) appears in the build folder. It contains the list of all files. You can read it in a post build step and then do anything you like (such as use that info for rewriting Chrome extension manifest).

Hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to block css cache without adding random number to it?
1 Answer 1 · Thanks Noopur,seems the best solution. · Just change path in gulp task rename from build to src · I...
Read more >
Build a Random Number Generator with HTML, CSS ...
Hi there , if you like my interesting and useful videos & want to support me, then you could buy me a coffee ......
Read more >
The issue with create-react-app is it creates a random hash ...
You can do it a number of ways, but the steps should always be: 1) Build prod bundle 2) Get hashes from asset-manifest.json...
Read more >
Lots of Ways to Use Math.random() in JavaScript - CSS-Tricks
Math.random() is an API in JavaScript. It is a function that gives you a random number. The number returned will be between 0...
Read more >
Math.random() - JavaScript - MDN Web Docs
Note: Math.random() does not provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API...
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