Git Product home page Git Product logo

Comments (13)

thorgeir avatar thorgeir commented on July 28, 2024 2

I've made a pull request #32 that should fulfill this issue. But it comes with one big caveat, it only works for files that have exactly one period (filename.ext)

from embeddedresourcevirtualpathprovider.

MatejSpin avatar MatejSpin commented on July 28, 2024 1

I will implement this in following days.

from embeddedresourcevirtualpathprovider.

mcintyre321 avatar mcintyre321 commented on July 28, 2024

Excellent, that sounds very useful.
On 19 Nov 2014 02:21, "cherrydev" [email protected] wrote:

Because the Vpp doesn't implement GetDirectory or DirectoryExists, the
Bundle.IncludeDirectory method doesn't work at all, which unfortunately
makes it rather limiting. I'm going to try to implement it, if that's
alright with you.


Reply to this email directly or view it on GitHub
#11
.

from embeddedresourcevirtualpathprovider.

ulrichb avatar ulrichb commented on July 28, 2024

Yes, would also need this feature. Without, I cannot use "*"-Includes when using System.Web.Optimization bundles.

from embeddedresourcevirtualpathprovider.

mcintyre321 avatar mcintyre321 commented on July 28, 2024

Awesome work @thorgeir . I'll need a bit of time to review this.

WRT the caveat - would it be possible to change is so files which contain multiple periods can be found at multuiple paths? e.g.

\foo\bar.baz.js, which would become a resource foo.bar.baz.js would be available at all combinations of virtual paths from /foo.bar.baz.js, /foo/bar.baz.js, /foo.bar/baz.js, /foo/bar/baz.js, if you see what I mean?

I haven't really though this through yet, so there may be a very good reason why this won't work.

If not though, it might be better if you could make this change, as it will stop people who aren't aware of the caveat from raising issues.

from embeddedresourcevirtualpathprovider.

thorgeir avatar thorgeir commented on July 28, 2024

We could generate every possible combination. but the main usage for this would be with bundles and if you know about this limitation you should be able to adjust your filenames to fit the pattern. Right? :)

from embeddedresourcevirtualpathprovider.

thorgeir avatar thorgeir commented on July 28, 2024

Also, if we make files accessible through all combinations, including ~/foo/*.js in a bundle would include all .js files in all sub-directories.

from embeddedresourcevirtualpathprovider.

mcintyre321 avatar mcintyre321 commented on July 28, 2024

So a big problem is it's pretty common for something to be called \js\jquery-1.5.1.min.js, - could some client of (configurable?) heuristic be used, that works with version numbers and .min?

Also, would my suggestion result in multiple identical files being returned? I'm not that familiar with the ins and outs of bundling.

from embeddedresourcevirtualpathprovider.

thorgeir avatar thorgeir commented on July 28, 2024

Some thing like this?

^(?<assembly>Assembly.Name)(\.(?<directory>.*?))?\.(?<filename>[^.]*([\.-](?<version>[0-9]\.[0-9]\.[0-9])(\.min)?)?\.[^.]*)$
Fiddle

from embeddedresourcevirtualpathprovider.

mcintyre321 avatar mcintyre321 commented on July 28, 2024

Very nice! Do you need the assembly name bit?

from embeddedresourcevirtualpathprovider.

mcintyre321 avatar mcintyre321 commented on July 28, 2024

Also, might be worth treating .less.css, .ts.js specially too... although that can be done later, .min is by far the most common case

from embeddedresourcevirtualpathprovider.

thorgeir avatar thorgeir commented on July 28, 2024

The initial resource name includes the assembly name, but it could be remove that before running the regex.
Also we could also make this configurable like the CacheControl bit.

from embeddedresourcevirtualpathprovider.

thorgeir avatar thorgeir commented on July 28, 2024

Ok, i've pushed these changes to the pull request. Review this and let me know what you think.

from embeddedresourcevirtualpathprovider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.