Skip to content
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

require_tree ../something works when compression: false even if path is not defined in assets:sources in _config.yml, but the same require_tree is silently ignored when compression: true #619

Open
5 tasks done
Nowaker opened this issue Oct 2, 2019 · 4 comments

Comments

@Nowaker
Copy link
Contributor

Nowaker commented Oct 2, 2019

Problem with require_tree

Use case:

  sources:
  - _assets/js
  - _assets/css
  - _assets/images
  - _assets/_sass/vendor/dreamhost-css/src/fonts
  # note: _assets/_sass/vendor/dreamhost-css/src/js is not listed here

main.js:

//=require_tree ../_sass/vendor/dreamhost-css/src/js

When compression: false is set, files inside the above directory will be included in the output of main.js.

However, when compression: true is set, this directory will NOT be included in the output of main.js. What's more, it will NOT raise any error during build.

require is not affected

  sources:
  - _assets/js
  - _assets/css
  - _assets/images
  - _assets/_sass/vendor/dreamhost-css/src/fonts
  # note: _assets/_sass/vendor/dreamhost-css/src/js is not listed here

main.js:

//=require ../_sass/vendor/dreamhost-css/src/js/scripts.js

require works as expected. That is, it raises an error.

Only after adding _assets/_sass/vendor/dreamhost-css/src/js to assets:sources makes it pass.

Request

Make require_tree always throw an error if the path where a JS is to be required from isn't listed in assets:sources, just like require.

  • I tried updating to the latest version
  • I Am on Linux
    • All Linuxes affected
  • I am on macOS 10.13
  • I am on macOS 10.14
@Nowaker Nowaker changed the title require_tree ../something works when compression: false even if path is not defined in assets:paths in _config, but the same require_tree is silently ignored when compression: true require_tree ../something works when compression: false even if path is not defined in assets:sources in _config.yml, but the same require_tree is silently ignored when compression: true Oct 2, 2019
@envygeeks
Copy link
Owner

I feel like this would be a Sprockets issue, all things considered we don't compress, or handle trees, we do indeed handle sources (we pass them into Sprockets) but other than that we don't typically deal with the compression, or the trees and finding assets.

@Nowaker
Copy link
Contributor Author

Nowaker commented Mar 7, 2020

I don't know if it's Sprockets or Jekyll-assets, but compression is a documented Jekyll-assets option and it doesn't work properly and is silent about it.

@envygeeks
Copy link
Owner

We can't be noisy about something we don't handle.

@envygeeks
Copy link
Owner

Let me rephrase because I don't want you to think I don't care, I do care it's silent, I just don't know why and I feel like this might be a sprockets but, but I do plan on looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants