Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Register Neat with asset pipeline when requisite #659

Closed
wants to merge 1 commit into from

Conversation

pungerfreak
Copy link
Contributor

This change is entirely based on a recent change to Bourbon (commit 8257c6) that will register Neat with the Rails asset pipeline.

This resolves a compatibility issue with Sprockets 4 where the SASS processor source map does not include Sass.load_paths.

It may be the issue also lies in the Sprockets court given this is an incompatibility introduced in v4, which is still in beta. However, it may be worthwhile to account for it on this side too to maintain as much compatibility as possible.

config.assets.paths << File.expand_path("../../core", __FILE__)
end
else
Sass.load_paths << File.expand_path("../../core", __FILE__)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/ExpandPathArguments: Use expand_path('../core', dir) instead of expand_path('../../core', FILE).

module Neat
if defined?(Rails) && defined?(Rails::Engine)
class Engine < ::Rails::Engine
config.assets.paths << File.expand_path("../../core", __FILE__)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/ExpandPathArguments: Use expand_path('../core', dir) instead of expand_path('../../core', FILE).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validation message is a bit cryptic. I'm not seeing anything in the suggested use that will actually work.

composerinteralia added a commit that referenced this pull request Nov 9, 2018
Closes #659

I didn't realize this PR had already been opened by another Daniel.
I changed a few little things, so I will merge this one instead with
a co-author.

Along the same lines as bourbon 8257c683f8, using `Sass.load_paths`
won't work if we happen to be using sassc-rails instead of sass-rails.
I ran into this when I was testing out
thoughtbot/suspenders#936.

Co-authored-by: Daniel Greenlaw <daniel@shirtspace.com>
@composerinteralia
Copy link
Contributor

composerinteralia commented Nov 9, 2018

Thanks! I opened a similar PR without realizing you had opened this one. Merged as a092ff7 with you listed as a co-author

@pungerfreak
Copy link
Contributor Author

Oh hey, thanks for sharing the love. - Daniel

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

Successfully merging this pull request may close these issues.

None yet

3 participants