Skip to content

Commit

Permalink
fix(serve): delete dist on serve (#4293)
Browse files Browse the repository at this point in the history
`ng serve` will serve the app from memory, but it's easy to think that it just serves what's in `dist/`.

This way, `dist/` is deleted on `ng serve` and users will not have a `dist/` dir where they might think the files are being served from.

Partially address #4290
  • Loading branch information
filipesilva authored and hansl committed Jan 31, 2017
1 parent 2211172 commit 8e82d17
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/angular-cli/tasks/serve.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as fs from 'fs';
import * as path from 'path';
import * as chalk from 'chalk';
import * as rimraf from 'rimraf';
const SilentError = require('silent-error');
const Task = require('../ember-cli/lib/models/task');
import * as webpack from 'webpack';
Expand All @@ -22,6 +23,9 @@ export default Task.extend({
const projectConfig = CliConfig.fromProject().config;
const appConfig = projectConfig.apps[0];

const outputPath = serveTaskOptions.outputPath || appConfig.outDir;
rimraf.sync(path.resolve(this.project.root, outputPath));

const serveDefaults = {
// default deployUrl to '' on serve to prevent the default from angular-cli.json
deployUrl: ''
Expand Down

0 comments on commit 8e82d17

Please sign in to comment.