Skip to content

gulp serve infinite build loop when using *.sass files #4332

@zyoungdev

Description

@zyoungdev

Category

  • Question
  • [ x] Bug
  • Enhancement

Expected or Desired Behavior

When developing an SPFx webpart, I converted the *.scss file to a *.sass file. gulp serve should work as expected.

Observed Behavior

gulp serve creates a *.sass.ts file in the same directory as the *.sass file. Since this hasn't been ignored by the gulp.watch command, it builds the solution infinitely without completing since the *.sass.ts has changed in the build process

Steps to Reproduce

convert *.scss files to *.sass files. Run gulp serve

Fix

In @microsoft/sp-build-web/lib/WebBuildRig.js, add the sass files and ignore the sass.ts files in the watch call on line 140 and 141.

Original code:

            executable: sp_build_common_1.serial(spBuildCoreTasks.serve, sp_build_common_1.watch(['src/**/*.{ts,tsx,scss,resx,js,json,html}',
                '!src/**/*.{scss.ts,resx.ts}'], sp_build_common_1.serial(result.get(WebBuildRigConstants_1.WebBuildRigConstants.tasks.bundle).executable, gulp_core_build_serve_1.reload))),

Working code:

            executable: sp_build_common_1.serial(spBuildCoreTasks.serve, sp_build_common_1.watch(['src/**/*.{ts,tsx,sass,scss,resx,js,json,html}',
                '!src/**/*.{sass.ts,scss.ts,resx.ts}'], sp_build_common_1.serial(result.get(WebBuildRigConstants_1.WebBuildRigConstants.tasks.bundle).executable, gulp_core_build_serve_1.reload))),

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolingCategory: Development toolingstatus:answeredAnswer to a question.type:questionQuestion... if answered, will be tagged as such.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions