Merging Sass compilation scripts in package.json for Rails Admin

56 views Asked by At

I'm encountering an error while integrating Rails Admin into my Rails application. When trying to add the Sass compilation script for Rails Admin in the package.json file as prompted, I'm continuously facing a merging conflict within the scripts.

Error Message:

    identical  app/assets/stylesheets/rails_admin.scss
    unchanged  config/initializers/assets.rb
            -  Add scripts to package.json
    You need to merge "scripts": {
      "build:css": "sass ./app/assets/stylesheets/rails_admin.scss:./app/assets/builds/rails_admin.css --no-source-map --load-path=node_modules"
    } into the existing scripts in your package.json.
    Taking 'build:css' as an example, if you're already have application.sass.css for the sass build, the resulting script would look like:
      sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css ./app/assets/stylesheets/rails_admin.scss:./app/assets/builds/rails_admin.css --no-source-map --load-path=node_modules

My gems:

    gem "rails", "~> 7.1.2"
    gem 'rails_admin', '>= 3.1.2'

My package json:

    {
      "scripts": {
        "build:css": "sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules"
      },
      "dependencies": {
        "rails_admin": "3.1.2",
        "sass": "^1.69.6"
      },
      "license": "MIT"
    }

Seeking guidance on how to effectively merge or configure the Sass compilation scripts in package.json to integrate Rails Admin without encountering merging conflicts.

Tried merging the Rails Admin Sass compilation script with the existing "build:css" script as prompted by the error message. Attempted separating the compilation steps into distinct scripts, but the error persists.

0

There are 0 answers