Invalid CSS Error Running gulp-ass

Asked 2 years ago, Updated 2 years ago, 85 views

I am trying to create a compilation environment for sass using gulp.I created various installations, gulpfile.js, and wrote a task in gulpfile.js, but this error does not compile well.

 events.js:160
      below;// Unhandled 'error' event
      ^
Error: develop/style.sass
Error: Invalid CSS after "body {": expected"}", was "{}"
        online1 of develop/style.sass
>> body {}
   ------^

    at options.error(/Users/suzuki/Local Sites/www/app/public/wp-content/themes/test/node_modules/node-ass/lib/index.js:291:26)

By the way, the file structure in gulpfile.js is written as follows.

project
     develop
        sass
     production
        ( ccss←I want to compile here)

↓In gulpfile.js

var gulp=require("gulp");
varass = require("gulp-sass");

gulp.task("sass", function(){
   gulp.src("/Users/suzuki/Local Sites/www/app/public/wp-content/themes/org/develop/style.sass")
       .pipe(sass())
       .pipe(gulp.dest("/Users/suzuki/Local Sites/wwww/app/public/wp-content/themes/org/production"))
       console.log("Complete Compilation");
});

This is the content of the style.I just put it in reference to the introductory article of sass.

html{
background:red;
body{
    background:blue;
}}

Thank you for your reply.

javascript gulp sass

2022-09-30 17:55

1 Answers

If you want to include the extension as ass, adjust it with indentation to represent the hierarchy.

html
  background:red;
  body
    background:blue;

I would like to write {} nesting from the description.If so, change the file extension to scss.

style.sass->style.scss

If the extension is scss, you can use the way you write the question.

html{
  background:red;
  body{
    background:blue;
  }
}


2022-09-30 17:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.