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

Is it possible to set the content scripts file name? #88

Open
KnightYoshi opened this issue Jan 24, 2021 · 5 comments
Open

Is it possible to set the content scripts file name? #88

KnightYoshi opened this issue Jan 24, 2021 · 5 comments
Labels

Comments

@KnightYoshi
Copy link

KnightYoshi commented Jan 24, 2021

Ideally I would like to have the content hash as part of the file name for the scripts '[contenthash]-[name].js', but I don't see anything about this accepting webpack output config, paths, or names, or accepting webpack template strings.

Is this possible, or does the script name have to be something that is predetermined?

@tm1000
Copy link
Member

tm1000 commented Apr 5, 2022

Can you let me know the thinking on this?

@KnightYoshi
Copy link
Author

The main idea I had behind it is that it allows me to quickly verify that the CI/CD pipeline consistently builds the same thing each time without having to use any file diffing tools. In the past The CI/CD pipeline would fail to pull in a dependency and thus when Firefox AMO reviewers would review the extension they would catch this when they diffed the files.

So this would allow us to leverage content hashes to quickly validate that the file contents are the same or not as part of QA. Webpack allows for using various tokens as part of the output for not only chunks, but also the entry scripts, it would be nice if this supported that as well. It would take some transformation in the manifest though, to transform from static name to the output file name

@tm1000
Copy link
Member

tm1000 commented Apr 6, 2022

I see. It looks like I would implement https://github.com/webpack/webpack/blob/main/lib/TemplatedPathPlugin.js to get this done

@KnightYoshi
Copy link
Author

Isn't that what Webpack already uses when you provide a file name like '[contenthash]-[name].js' as the output.filename? The thing is that the manifest.json doesn't know about the dynamic part of that. So the file name just has to be content.js as the entry and the output file name. If I have the output.filename include a template token the manifest.json would still just have content.js instead of output file name: abc134-content.js

@stale
Copy link

stale bot commented Nov 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Nov 9, 2022
@tm1000 tm1000 added pinned and removed wontfix This will not be worked on labels Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants