Skip to content
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

How to compile scss to css on npm start #10

Open
VishalGulati opened this issue Nov 4, 2016 · 0 comments
Open

How to compile scss to css on npm start #10

VishalGulati opened this issue Nov 4, 2016 · 0 comments

Comments

@VishalGulati
Copy link

I am unable to compile scss files to css once the application is run using npm start. Is there a way to live reload a sass to css like ts are compiled to js by utility tsc:w. Likewise how can I run gulp watch in sync with npm start or the other way using node-sass on npm start? I tried below approaches but none worked.
Here is the code in package.json:

Using gulp watch:


    "start": "concurrently \"npm run tsc:w\" \"npm run lite\" \"gulp\" ", 
    //also tried gulp watch and that did not work too.
    "start": "concurrently \"npm run tsc:w\" \"npm run lite\" \"gulp watch\" ",

here is my gulppfile.js in the root directory:

    'use strict';
    var gulp = require('gulp');
    var sass = require('gulp-sass');
    gulp.task('sass', function () {
      gulp.src('./sass/**/*.scss')
        .pipe(sass().on('error', sass.logError))
        .pipe(gulp.dest('./css'));
    });
    gulp.task('sass:watch', function () {
      gulp.watch('./sass/**/*.scss', ['sass']);
    });

Using node-sass command:


    "start": "concurrently \"npm run tsc:w\" \"npm run lite\" \"npm run sass\" ",             
    "sass": "node-sass -w app/sass/ -o app/css/",

Could anyone pls tell what I am missing or what is the right way to do it? TIA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant