Skip to content

Use node-sass-chokidar instead of node-sass #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ function convert(logger, projectDir, options) {
return new Promise(function (resolve, reject) {
options = options || {};

var peerSassPath = path.join(__dirname, '../../node-sass');
var sassPath = path.join(peerSassPath, 'bin/node-sass');
var peerSassPath = path.join(__dirname, '../../node-sass-chokidar');
var sassPath = path.join(peerSassPath, 'bin/node-sass-chokidar');
var appDir = path.join(projectDir, "app");
var importerPath = path.join(__dirname, "importer.js");

if (fs.existsSync(sassPath)) {
try {
logger.info('Found peer node-sass');
logger.info('Found peer node-sass-chokidar');
} catch (err) { }
} else {
throw Error('node-sass installation local to project was not found. Install by executing `npm install node-sass`.');
throw Error('node-sass-chokidar installation local to project was not found. Install by executing `npm install node-sass-chokidar`.');
}

// Node SASS Command Line Args (https://github.com/sass/node-sass#command-line-interface)
Expand All @@ -30,9 +30,9 @@ function convert(logger, projectDir, options) {
// --follow : Follow symlinked directories
// -r : Recursively watch directories or files
// --watch : Watch a directory or file
var nodeArgs = [sassPath, appDir, '--output', appDir, '--output-style', 'compressed', '-q', '--follow', '--importer', importerPath];
var nodeArgs = [sassPath, appDir, '-o', appDir, '--output-style', 'compressed', '-q', '--follow', '--importer', importerPath];
if (options.watch) {
nodeArgs.push('-r', '--watch');
nodeArgs.push('--recursive', '--watch');
}

logger.trace(process.execPath, nodeArgs.join(' '));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
"dependencies": {
"bluebird": "^3.4.6",
"node-sass": "^4.7.1",
"node-sass-chokidar": "^0.0.3",
"glob": "^7.1.2",
"nativescript-hook": "^0.2.0"
},
Expand Down