Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Watch mode watches its own output recursively if output directory descends from the input directory. #2184

@shirakaba

Description

@shirakaba

Minimum reproduction

Module.scss:

.moduleStyle {
    opacity: 1;
}
node_modules/.bin/node-sass --watch src/scss --output src/scss/css_prebuild

Behaviour

In watch mode, it emits to src/scss/css_prebuild, then emits again to src/scss/css_prebuild/css_prebuild. This may happen recursively (albeit limited to one level by some safety factor).

my-mac:myProject me$ node_modules/.bin/node-sass --watch src/scss --output src/scss/css_prebuild
=> changed: /Users/me/Sites/myProject/src/scss/video.scss
Rendering Complete, saving .css file...
Wrote CSS to /Users/me/Sites/myProject/src/scss/css_prebuild/video.css
=> changed: /Users/me/Sites/myProject/src/scss/css_prebuild/video.css
Rendering Complete, saving .css file...
Wrote CSS to /Users/me/Sites/myProject/src/scss/css_prebuild/css_prebuild/video.css

Proposal

Two options:

  • --watch mode should not default to adding the --recursive flag.

  • There should be a way to exclude paths or ignore directories, and the output directory should be implicitly ignored.

Configuration

  • NPM version (npm -v): 5.4.2
  • Node version (node -v): 8.7.0
  • Node Process (node -p process.versions):
{ http_parser: '2.7.0',
  node: '8.7.0',
  v8: '6.1.534.42',
  uv: '1.15.0',
  zlib: '1.2.11',
  ares: '1.10.1-DEV',
  modules: '57',
  nghttp2: '1.25.0',
  openssl: '1.0.2l',
  icu: '59.1',
  unicode: '9.0',
  cldr: '31.0.1',
  tz: '2017b' }
  • Node Platform (node -p process.platform): darwin
  • Node architecture (node -p process.arch): x64
  • node-sass version (node -p "require('node-sass').info"):
node-sass	4.7.2	(Wrapper)	[JavaScript]
libsass  	3.5.0.beta.2	(Sass Compiler)	[C/C++]
  • npm node-sass versions (npm ls node-sass):
myProject@1.0.0 /Users/me/Sites/myProject
└── node-sass@4.7.2 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions