diff --git a/Gemfile.lock b/Gemfile.lock index 466ed6b..170cafb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - cssbundling-rails (1.1.0) + cssbundling-rails (1.1.1) railties (>= 6.0.0) GEM @@ -96,11 +96,11 @@ GEM mini_mime (1.0.3) minitest (5.14.4) nio4r (2.5.7) - nokogiri (1.11.7-arm64-darwin) + nokogiri (1.13.6-arm64-darwin) racc (~> 1.4) - nokogiri (1.11.7-x86_64-darwin) + nokogiri (1.13.6-x86_64-darwin) racc (~> 1.4) - nokogiri (1.11.7-x86_64-linux) + nokogiri (1.13.6-x86_64-linux) racc (~> 1.4) public_suffix (4.0.6) racc (1.5.2) diff --git a/README.md b/README.md index 848d3ce..ff12ef5 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,8 @@ You can configure your bundler options in the `build:css` script in `package.jso You must already have node and yarn installed on your system. You will also need npx version 7.1.0 or later. Then: -1. Add `cssbundling-rails` to your Gemfile with `gem 'cssbundling-rails'` -2. Run `./bin/bundle install` -3. Run `./bin/rails css:install:[tailwind|bootstrap|bulma|postcss|sass]` +1. Run `./bin/bundle add cssbundling-rails` +2. Run `./bin/rails css:install:[tailwind|bootstrap|bulma|postcss|sass]` Or, in Rails 7+, you can preconfigure your new application to use a specific bundler with `rails new myapp --css [tailwind|bootstrap|bulma|postcss|sass]`. @@ -42,6 +41,10 @@ If you want to use `@import` statements as part of your Tailwind application.js Some CSS packages use new CSS features that are not supported by the default SassC rails integration that previous versions of Rails used. If you hit such an incompatibility, it'll likely be in the form of a `SassC::SyntaxError` when running `assets:precompile`. The fix is to `bundle remove sass-rails` (or `sassc-rails`, if you were using that). +### Why do I get `application.css not in asset pipeline` in production? + +A common issue is that your repository does not contain the output directory used by the build commands. You must have `app/assets/builds` available. Add the directory with a `.gitkeep` file, and you'll ensure it's available in production. + ## License CSS Bundling for Rails is released under the [MIT License](https://opensource.org/licenses/MIT). diff --git a/lib/cssbundling/version.rb b/lib/cssbundling/version.rb index efdd2ff..15fda7f 100644 --- a/lib/cssbundling/version.rb +++ b/lib/cssbundling/version.rb @@ -1,3 +1,3 @@ module Cssbundling - VERSION = "1.1.0" + VERSION = "1.1.1" end diff --git a/lib/install/bootstrap/install.rb b/lib/install/bootstrap/install.rb index ab16124..cfab96a 100644 --- a/lib/install/bootstrap/install.rb +++ b/lib/install/bootstrap/install.rb @@ -17,7 +17,7 @@ end say "Add build:css script" -build_script = "sass ./app/assets/stylesheets/application.bootstrap.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules" +build_script = "sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules" if (`npx -v`.to_f < 7.1 rescue "Missing") say %(Add "scripts": { "build:css": "#{build_script}" } to your package.json), :red diff --git a/lib/install/bulma/install.rb b/lib/install/bulma/install.rb index ff4980d..d70fa1b 100644 --- a/lib/install/bulma/install.rb +++ b/lib/install/bulma/install.rb @@ -4,7 +4,7 @@ run "yarn add sass bulma" say "Add build:css script" -build_script = "sass ./app/assets/stylesheets/application.bulma.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules" +build_script = "sass ./app/assets/stylesheets/application.bulma.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules" if (`npx -v`.to_f < 7.1 rescue "Missing") say %(Add "scripts": { "build:css": "#{build_script}" } to your package.json), :red diff --git a/lib/install/dev b/lib/install/dev index a1104a5..c1cb98b 100755 --- a/lib/install/dev +++ b/lib/install/dev @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if ! command -v foreman &> /dev/null +if ! foreman version &> /dev/null then echo "Installing foreman..." gem install foreman diff --git a/lib/install/sass/install.rb b/lib/install/sass/install.rb index 5d8f295..dbef54d 100644 --- a/lib/install/sass/install.rb +++ b/lib/install/sass/install.rb @@ -3,7 +3,7 @@ run "yarn add sass" say "Add build:css script" -build_script = "sass ./app/assets/stylesheets/application.sass.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules" +build_script = "sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules" if (`npx -v`.to_f < 7.1 rescue "Missing") say %(Add "scripts": { "build:css": "#{build_script}" } to your package.json), :red