propshaft | Deliver assets for Rails | Continous Integration library
kandi X-RAY | propshaft Summary
kandi X-RAY | propshaft Summary
Propshaft is an asset pipeline library for Rails. It's built for an era where bundling assets to save on HTTP connections is no longer urgent, where JavaScript and CSS are either compiled by dedicated Node.js bundlers or served directly to the browsers, and where increases in bandwidth have made the need for minification less pressing. These factors allow for a dramatically simpler and faster asset pipeline compared to previous options, like Sprockets.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Resolve path to a path
- Initialize a new asset
- Returns the contents of the manifest .
propshaft Key Features
propshaft Examples and Code Snippets
Community Discussions
Trending Discussions on propshaft
QUESTION
So I have a file not found problem. I have an engine that works in development mode in the engines test/dummy app, the engine allows the editing of sass variables and stores them in a theme table, the variables are used by a sass partial such as _banner.scss containing variables used in the main stylesheet such as $banner_color which is then imported into the main stylesheet which in turn is precompiled using an initializer in the engine.rb file and inclusion in the app/config/engine_name_manifest.js.
The files are all available in development with the local dummy app but not in the eventual host app due to the assets being compiled.
I have a rake task that takes the data, updates the relevant partial e.g. _banner.scss with the data from the theme table but of course the partials are not not available in a host app as the engine has already compiled them. I'm looking for a solution that will allow me to edit the raw, uncompiled stylesheets then recompile them. Obviously my Capistrano deploy script will need to reapply the stylesheet changes every deployment but that is just a rake task call. What approach should I take? Should I find a way to copy the css files to the host app in an engine initializer? Should I use a different approach entirely, I have started looking at propshaft but that is a massive step to replace sass rails and I'm not sure how that would help
The engine
...ANSWER
Answered 2022-Apr-02 at 03:44Thanks for clarifying. If I understood correctly here my take on it.
partials are not not available in a host app as the engine has already compiled them
Partials are still there, precompilation just outputs *.{css/js}
files into public/assets/
that are declared in app/assets/config/manifest.js
.
To get to engines files, instead of Rails.root
use:
QUESTION
I'll write down my path and version of ruby and rails on my machine first then the error I'm having.
which rails
/Users/alex/.rvm/gems/ruby-3.0.3/bin/rails
rails -v
Rails 7.0.1
which ruby
/Users/alex/.rvm/rubies/ruby-3.0.3/bin/ruby
ruby -v
ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-darwin21]
When I try to run rails console
, it does not run but show these options:
ANSWER
Answered 2022-Jan-10 at 09:40Have you created a Rails app? Looks like you're running rails console
in a directory that has no Rails app created yet.
You should create a new app using rails new [app_name]
, then run rails console
. Or, make sure that you're in the root directory of your existing Rails app.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install propshaft
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page