Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON file with same name as JS file is fingerprinted in code but not on disk, if 'json' not in extensions to process #94

Open
djmitchella opened this issue Apr 7, 2016 · 0 comments

Comments

@djmitchella
Copy link

Repro steps:

npm install --save broccoli
npm install --save broccoli-asset-rev
mkdir app
echo "hello" > app/test.js
echo "there" > app.test.json

Create app/index.html containing

<script src="test.js">
<script src="test.json">

Create Brocfile.js containing:

var AssetRev = require('broccoli-asset-rev');
var assetNode = new AssetRev('app', {});
module.exports = assetNode;

Run broccoli build dist

Now, look in the 'dist' folder. It contains

test-b1946ac92492d2347c6235b4d2611184.js
test.json

so you can see that test.js has been fingerprinted, and test.json has not. This is reasonable, the default file extensions for broccoli-asset-rev contains "js" but not "json".

Now look inside dist/index.html. It contains:

<script src="test-b1946ac92492d2347c6235b4d2611184.js">
<script src="test-b1946ac92492d2347c6235b4d2611184.json">

Notice that it has replaced the reference to test.json with the same fingerprint that it used for test.js, even though a:test.json should have a different fingerprint as it has different contents, and b:the test.json file in the 'dist' folder didn't get renamed, so the reference shouldn't have changed.

If I add 'json' to the list of extensions to process in the options, then it starts to work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant