Coder Social home page Coder Social logo

Only return url about minify HOT 9 CLOSED

ceesvanegmond avatar ceesvanegmond commented on June 25, 2024
Only return url

from minify.

Comments (9)

ceesvanegmond avatar ceesvanegmond commented on June 25, 2024

@Propaganistas Can you try the develop branch? I've added an new function.

Minify::stylesheet('/css/main.css')->onlyUrl()

You can also continue chaining

Minify::stylesheet('/css/main.css')->withFullUrl()->onlyUrl()

Is this something you can use to solve this problem?

from minify.

Propaganistas avatar Propaganistas commented on June 25, 2024

Hi @ceesvanegmond
Thanks for picking this up.

I've tried the develop branch but it seems that the onlyUrl() method still outputs a <link> tag?

from minify.

ceesvanegmond avatar ceesvanegmond commented on June 25, 2024

Are you sure? I tested it again and this is not the case here.

from minify.

Propaganistas avatar Propaganistas commented on June 25, 2024

Ah, after some additional testing I found that the new onlyUrl() method still outputs a tag when the current environment is set to be ignored in config. In 'valid' environments the method is returning a relative path.

2 future works in my opinion:

  • ignored environments should also return a plain url for consistency?
  • maybe provide also a way to request an absolute url?

from minify.

ceesvanegmond avatar ceesvanegmond commented on June 25, 2024

@Propaganistas We could definitely build that, but what would the minifier return when you provider more than one one in stylesheet() or javascript?

from minify.

Propaganistas avatar Propaganistas commented on June 25, 2024

That's indeed a valid point; skip the first suggestion.
The absolute URL of the minified file could still be of use.

from minify.

ceesvanegmond avatar ceesvanegmond commented on June 25, 2024

@Propaganistas Do you have an proposal?

from minify.

Propaganistas avatar Propaganistas commented on June 25, 2024

Haven't tested it, but as far as I can see this can already be achieved by chaining withFullUrl() and onlyUrl().

from minify.

sirsquall avatar sirsquall commented on June 25, 2024

I have merge the branch develop manually to have the onlyUrl().

For the ignored enviroments, the onlyUrl() will not work because the env is ignored, and there is no need for the CDN.

from minify.

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.