Skip to content

build: scss changes not live-reloading #4870

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

Merged
merged 1 commit into from
May 30, 2017
Merged
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
5 changes: 5 additions & 0 deletions tools/gulp/tasks/development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ task(':watch:devapp', () => {
watch(join(appDir, '**/*.ts'), [':build:devapp:ts', triggerLivereload]);
watch(join(appDir, '**/*.scss'), [':build:devapp:scss', triggerLivereload]);
watch(join(appDir, '**/*.html'), [':build:devapp:assets', triggerLivereload]);

// The themes for the demo-app are built by the demo-app using the SCSS mixins from Material.
// Therefore when the CSS files have been changed the SCSS mixins have been refreshed and
// copied over. Rebuilt the theme CSS using the updated SCSS mixins.
watch(join(DIST_MATERIAL, '**/*.css'), [':build:devapp:scss', triggerLivereload]);
});

/** Path to the demo-app tsconfig file. */
Expand Down
4 changes: 3 additions & 1 deletion tools/gulp/util/task_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as fs from 'fs';
import * as gulp from 'gulp';
import * as path from 'path';
import {PROJECT_ROOT} from '../build-config';
import {yellow} from 'chalk';

/* Those imports lack typings. */
const gulpClean = require('gulp-clean');
Expand Down Expand Up @@ -173,7 +174,8 @@ export function serverTask(packagePath: string, livereload = true) {

/** Triggers a reload when livereload is enabled and a gulp-connect server is running. */
export function triggerLivereload() {
gulp.src('dist').pipe(gulpConnect.reload());
console.log(yellow('Server: Changes were detected and a livereload was triggered.'));
return gulp.src('dist').pipe(gulpConnect.reload());
}


Expand Down