Comments (6)
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.
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.
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.
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.
Fixed in 1.7.6.
from assetgraph-builder.
@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)
- Dedupe source maps HOT 1
- RSS feed link gets updated wrong
- When browsers list is not configured, look for it in package.json HOT 2
- Support .browserslistrc and browserslist key in package.json HOT 5
- Is it possible to wrap the built JS in a function to not expose define() ? HOT 4
- Throws when encountering Html Svg island with inline style HOT 1
- Generates invalid syntax from ES6 code HOT 4
- `node-zopfli` package seems no longer maintained HOT 5
- Ruby Sass is deprecated HOT 2
- Add `--preflight-check` cmdline option HOT 7
- `npm audit` complaints HOT 6
- Breaks await expression HOT 4
- Breaks relative ES6 module paths HOT 4
- ⚠ WARN: Cannot read property 'length' of null HOT 2
- [Q] CHANGELOG? HOT 4
- make assetgraph to not process svg HOT 2
- Translation not working HOT 1
- How to customize? HOT 3
- a vulnerability CVE-2020-7598 is introduced in assetgraph-builder
- Svgo is not a constructor HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assetgraph-builder.