Skip to content

Commit

Permalink
build: fix serve task (#3794)
Browse files Browse the repository at this point in the history
* build: fix serve task

* Currently when serving the dev-app or e2e-app and chanages are recognized, the library task will run. This task clears the whole `dist/` and rebuilds then.

* This is problematic because sometimes only the library will be rebuilt and for example the `dev-app` won't be rebuilt. After the task ran, the `dev-app` is removed and the serve task will crash.

* Rename to library:clean-build
  • Loading branch information
devversion authored and tinayuangao committed Mar 29, 2017
1 parent becb7a8 commit 07bc4ad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tools/gulp/tasks/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ const bundlesDir = DIST_BUNDLES;

const esmMainFile = join(materialDir, 'index.js');

task('library:clean-build', sequenceTask('clean', 'library:build'));

task('library:build', sequenceTask(
'clean',
['library:build:esm', 'library:assets'],
// Inline assets into ESM output.
'library:assets:inline',
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {DIST_MATERIAL} from '../constants';
gulp.task('lint', ['tslint', 'stylelint', 'madge']);

/** Task that runs madge to detect circular dependencies. */
gulp.task('madge', ['library:build'], execNodeTask('madge', ['--circular', DIST_MATERIAL]));
gulp.task('madge', ['library:clean-build'], execNodeTask('madge', ['--circular', DIST_MATERIAL]));

/** Task to lint Angular Material's scss stylesheets. */
gulp.task('stylelint', execNodeTask(
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {openFirebaseDashboardDatabase} from '../util/firebase';
const bundlesDir = join(DIST_ROOT, 'bundles');

/** Task which runs test against the size of whole library. */
task('payload', ['library:build'], () => {
task('payload', ['library:clean-build'], () => {

let results = {
umd_kb: getBundleSize('material.umd.js'),
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const themingBundlePath = join(DIST_RELEASE, '_theming.scss');
const prebuiltThemeGlob = join(DIST_MATERIAL, '**/theming/prebuilt/*.css');

task('build:release', sequenceTask(
'library:build',
'library:clean-build',
':package:release',
));

Expand Down

0 comments on commit 07bc4ad

Please sign in to comment.