Git Product home page Git Product logo

Comments (6)

papandreou avatar papandreou commented on June 17, 2024

Hmm, this happens because the code that bundles JavaScript and CSS replaces the original references. In your case where there's just one file in each "bundle", I agree -- whether it's an absolute, protocol-relative, root-relative or relative url should be preserved. However, what would you expect to happen when these scripts are bundled?

<script src="foo.js"></script>
<script src="/bar.js"></script>
<script src="//quux.com/bar.js"></script>
<script src="http://quux.com/bar.js"></script>

Should the bundling code look for the most specific reference and preserve that, or what would make sense?

from assetgraph-builder.

mreinstein avatar mreinstein commented on June 17, 2024

For fully qualified references like http://quux.com/bar.js I'd expect those to be left alone; since you can't really modify scripts loaded over the network. There are probably some people declaring their own scripts this way but I can't imagine why.

I think probably the same for //quux.com/bar.js I'm not sure how else you'd handle the local file reference.

the first 2 seem like the most common use cases by far; the resource is either referenced relatively to it's current location, or absolute path.

from assetgraph-builder.

mreinstein avatar mreinstein commented on June 17, 2024

I really don't like using absolute paths in my app but for deeply nested URL paths there doesn't seem to be any good alternative.

from assetgraph-builder.

Munter avatar Munter commented on June 17, 2024

I'm wondering why you are running into this problem. I've built several applications or static sites with html-files in subdirectories. Assetgraph points correctly to the static assets with relative urls, also for html-files in subdirectories, which makes you able to deploy on any nesting level you'd like. It does however require that the html-file swas originally a part of the graph. Is this the case here?

Are you maybe compiling a html-template for a serverside language, which then in turn serves the template from a sub-path later?

from assetgraph-builder.

papandreou avatar papandreou commented on June 17, 2024

Fixed in 1.7.6.

from assetgraph-builder.

mreinstein avatar mreinstein commented on June 17, 2024

@Munter It does however require that the html-file swas originally a part of the graph. Is this the case here?

I think only my index page is getting included in the graph. I don't think my other html views are getting included. So everything in my template directory is not being traversed. I'm assuming I should add them using the wildcard glob format on the command line?

Are you maybe compiling a html-template for a serverside language, which then in turn serves the template from a sub-path later?
No nothing fancy like that. All of the template rendering happens on the client. The backend is pretty dumb, it just serves the static files and provides an API for the dynamic calls.

from assetgraph-builder.

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.