You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
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
The text was updated successfully, but these errors were encountered:
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
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.
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.
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.
Problem with
require_tree
Use case:
main.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 affectedmain.js:
require
works as expected. That is, it raises an error.Only after adding
_assets/_sass/vendor/dreamhost-css/src/js
toassets: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 inassets:sources
, just likerequire
.The text was updated successfully, but these errors were encountered: