embroider-build / ember-auto-import

Zero config import from npm packages
Other
360 stars 109 forks source link

ember-auto-import fingerprint ember files during build #176

Open ashjackguo opened 5 years ago

ashjackguo commented 5 years ago

In my current project

When I installed ember-auto-import and ran ember build it will fingerprint my dsit files even though I already set fingerprint: false in my ember-cli-build.js.

inkedimage_li

Is there an option that I can turn this off?

ef4 commented 5 years ago

Try fingerprint: { enabled: false }.

(I wasn't aware that fingerprint: false is supported, but we can make that work too. The only reason auto-import cares is that it augments your fingerprint settings to make sure that any lazy chunks don't get fingerprinting, because they already have it and we need to know their URLs.)

ashjackguo commented 5 years ago

@ef4 Do I place fingerprint: { enabled: false } in the autoImport config?

It would great if you guys can add that option!

Thank you for the fast response!

ashjackguo commented 5 years ago

@ef4 You can close this pbi if you want! I fixed it by placing fingerprint: { enabled: false } in ember-cli-build.js.

I suggest to add this configuration to the doc so people like me don't have to spend tons of hours looking into it!

Thanks for your help!

ef4 commented 5 years ago

(This issue is deliberately still open because I consider this a bug anyway. We should make it work automatically without a workaround.)

jasonmevans commented 5 years ago

@ef4 Is there an ETA on this issue? This is somewhat high priority for us since we are relying on fingerprinting and auto-import for our vendor assets. We have temporarily disabled fingerprinting in our app, but would like to plan when it can be re-enabled to mitigate potential production issues.

To elaborate on our problem, we are seeing auto import resources being built with this filename, /assets/chunk.51a56d5eceb474939f06-75ed1f1c6f1911dd87c7e4f2f3d91e42.js, but the application requests files without the fingerprint, /assets/chunk.51a56d5eceb474939f06.js.

It would be great if we were able to disable fingerprinting during asset generation on a chunk-by-chunk basis, but better if the auto import requested fingerprinted assets without any more configuration.

If you would like I can put together a demo app that can illustrate the problem.

Thank you! 😄

ef4 commented 5 years ago

@jasonmevans the thing you're describing is different from this bug, please file a separate one and share whatever reproduction you can. Thanks.

mansona commented 1 year ago

This issue is deliberately still open because I consider this a bug anyway. We should make it work automatically without a workaround

I'm not sure I agree with you on this one @ef4 🤔 the screenshot in the initial post shows that all the files are fingerprinted, so it would seem that ember-cli doesn't support fingerprint: false to turn off fingerprinting. However we just did a test and it looks like the chunks that ember-auto-import generates are all fingerprinted, but I'm not sure that counts for this issue 🤔

image (10)

Is that considered the same thing as "fingerprinting" in this context? or is it some hash that webpack is adding for us?

ef4 commented 1 year ago

The main issue here is making sure that ember-auto-import doesn't mess with the user's broccoli-asset-rev settings in a surprising way when we do https://github.com/embroider-build/ember-auto-import/blob/843ed86e7fc61c5c29c012738b905a551cb4d49a/packages/ember-auto-import/ts/auto-import.ts#L210-L226

If there's no supported config that we break, then we can close this. My impression from the original report was that there was a case that we break.