-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
🙋 how to keep html name #280
Comments
this is somewhat related to #270 |
This shouldn't be a hard fix, related code: Lines 146 to 166 in c008bb0
|
Should I include this in my change ? |
@ssuman if you want, go for it :) |
Sure will include this in my PR. |
In assetgraph-builder we also hash filenames, but exclude any files matching the following from renaming:
More rules might need to be added in the future of course, but these ones have covered us well for a couple of years |
Would it be possible to completely disable file name hashing with an option (to the cli)? |
@eirikb this will be hard as it will not be prone to overwriting. For example index.js and ./src/somefolder/index.js will both be saved to index.js but they should be different bundles. However it might be possible to use a relative path and use that to write bundles into a directory tree similar to the source one. I'm not sure what the specific usecase for this is though. |
@DeMoorJasper the use case is having an actual site with human/SEO filenames, e.g.
instead of
|
Having pages that can be linked to from the outside because of predictable URL' s is a pretty big use case. It's the core functionality of the web |
I kinda got aff-topic with my comment, talking about duplicates mainly focusing on javascript and such. // HTML Asset getBundleName()
if (this.parent === null || this.parent.type === 'html') {
// Only keep name if it's the main bundle or it's being required from html (for example through <a href=...
// As this might possibly break if html is being used as a template inside JS, TS,...
return path.join(this.relativePath, this.name);
} This should only happen in htmlAssets (and maybe rawAsset - pictures and such) as far as i know |
@DeMoorJasper If you only look at the parent, you'll get a bunch of static assets that could easily be content addressable, but keep their non-hashed file name. When you are finding the edges in the graph are you not also recording the type of edge it is? This is highly valuable information for knowing what to rename under which circumstances. The rule about keeping names on entry points and anything pointed to by an html anchor is good. But there are a few more quite important assets not to rename. See #280 (comment) |
Will this give me friendlier filenames to use with Angular 1.x directive |
Should be solved by #1025 which retains filenames and folder structure for linked files, and content hashes static assets. Please help test using the master branch - a release will hopefully come next week! |
Hi, You mention Currently I am producing a |
I can only speak to what we did in assetgraph-builder. There we infer the asset type from the way it is marked up as a If you were to just anchorlink to the xml file it would just be inferred as an xml file with no special significance. From looking at https:/parcel-bundler/parcel/blob/master/packages/core/parcel-bundler/src/assets/HTMLAsset.js I can't see any similar special categorization of feeds and indeed https:/parcel-bundler/parcel/tree/master/packages/core/parcel-bundler/src/assets also doesn't seem to have have any special handling. So in Parcel your feed is probably just treated equally to any other static asset with no special handling to keep urls stable |
I currently have the following markup:
Which is being transformed into:
Which is less than ideal. I've read everything I could find, but I've not found a way to exclude these files. Any suggestions? Many thanks! |
where am I suppose to add this piece of code? |
this page will compile to
I want to keep html name, my expectation:
Please tell me how to config ?
The text was updated successfully, but these errors were encountered: