App.css link not getting set correctly


#1

When running ember build --environment production all my assets build fine:

Built project successfully. Stored in "dist/".
File sizes:
- dist/assets/auto-import-fastboot-d41d8cd98f00b204e9800998ecf8427e.js: 0 B
- dist/assets/ctest-fe-64cf84a9a5edf026486a9415dd62f4d5.js: 427.23 KB (90.48 KB gzipped)
- dist/assets/ctest-fe-6cd3bd9f0788ba5c28c22435b23f8ace.css: 82.38 KB (13.22 KB gzipped)
- dist/assets/vendor-2b3dd0afae7214b579227e88966099f3.css: 4.19 KB (1.08 KB gzipped)
- dist/assets/vendor-f240c0381cd75e408164bbe8211aad89.js: 1.76 MB (426.21 KB gzipped)

But it builds the index.html wrong. It’s not getting the right url for app.css:

<!DOCTYPE html>
<html>
  <head>
    ...
    <link integrity="" rel="stylesheet" href="/assets/vendor-2b3dd0afae7214b579227e88966099f3.css">
    <link integrity="" rel="stylesheet" href="/assets/ctest-fe.css">
    ...
  </head>
  ...
</html>

The source index.html I’m using is just the plain one that ember new creates. In there, the link tags look like this by default, and it’s exactly what I have:

<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/ctest-fe.css">

Does anyone have any idea where the magic is that is supposed to make this work or why it wouldn’t be doing it?

ember-cli 3.5.1


#2

I would guess a bug in broccoli-asset-rewrite. It uses regular expressions in a way that isn’t really sound, so these weird bugs have crept up from time to time.

(Your app depends on broccoli-asset-rev, and broccoli-asset-rev uses broccoli-asset-rewrite to rewrite index.html to point at the fingerprinted files.)