Complete URLs for React JS bundles

Hi all,

I had a quick question about the CSS and JS files that are referenced in my Create React App. I see that the CSS files are linked using their full URL:

https://d33wubrfki0l68.cloudfront.net/css/0e0e3e687a14f2df802428cd62cf5a01f93c65c5/static/css/main.a0e76e78.chunk.css

However the JS files are linked using:

/static/js/2.ae69aed9.chunk.js

Any idea how I can have the JS files do the same?

The above is causing in an issues because some of the older deploys are referencing JS files that don’t exist anymore.

Thanks.

That URL is generated based on a content/asset fingerprint that is generated at deploy time, and is not available during your build for you to use. If you have unique requirements around those paths matching, you can disable our asset optimization completely, and all URL’s will look as you expect rather than being transformed by our service.

Oh I think the asset optimization feature is very useful! I just wonder if it can be applied to the JS files in a Create React App as well? Right now it’s only being applied to the CSS files.

Also, are there any docs on this feature so I can read up on it further?

Thanks.

Let us know if this doc is helpful: https://docs.netlify.com/configure-builds/file-based-configuration/#post-processing