@@ -19,22 +19,8 @@ module.exports = Task.extend({
19
19
run : function ( commandOptions : ServeTaskOptions ) {
20
20
21
21
let webpackCompiler : any ;
22
- // if (commandOptions.environment === 'material') {
23
- // webpackDevMaterialConfig.entry.main.unshift(`webpack-dev-server/client?http://localhost:${commandOptions.port}/`);
24
- // webpackCompiler = webpack(webpackDevMaterialConfig);
25
-
26
- // } else if (commandOptions.environment === 'e2e') {
27
- // webpackDevMaterialE2EConfig.entry.main.unshift(`webpack-dev-server/client?http://localhost:${commandOptions.port}/`);
28
- // webpackCompiler = webpack(webpackDevMaterialE2EConfig);
29
-
30
- // } else {
31
- // webpackDevConfig.entry.main.unshift(`webpack-dev-server/client?http://localhost:${commandOptions.port}/`);
32
- // webpackCompiler = webpack(webpackDevConfig);
33
- // }
34
-
35
- // since the .config method on the returned instance is just an object we can modify any part of it for our needs
36
- var config = new NgCliWebpackConfig ( this . project , commandOptions . environment ) . config ;
37
- config . entry . main . unshift ( `webpack-dev-server/client?http://localhost:${ commandOptions . port } /` ) ;
22
+
23
+ var config : NgCliWebpackConfig = new NgCliWebpackConfig ( this . project , commandOptions . environment ) . config ;
38
24
webpackCompiler = webpack ( config ) ;
39
25
40
26
@@ -44,7 +30,7 @@ module.exports = Task.extend({
44
30
} ) ) ;
45
31
46
32
const webpackDevServerConfiguration : IWebpackDevServerConfigurationOptions = {
47
- contentBase : path . resolve ( process . cwd ( ) , './src' ) ,
33
+ contentBase : path . resolve ( this . project . root , './src' ) ,
48
34
historyApiFallback : true ,
49
35
stats : webpackDevServerOutputOptions ,
50
36
inline : true
@@ -54,7 +40,6 @@ module.exports = Task.extend({
54
40
const server = new WebpackDevServer ( webpackCompiler , webpackDevServerConfiguration ) ;
55
41
56
42
return new Promise ( ( resolve , reject ) => {
57
- process . stdout . write ( chalk . red ( '\n\n' + chalk . underline . bgYellow ( 'TODO#' ) , 'Implement ENV Flags for serve builds.\n\n' ) ) ;
58
43
server . listen ( commandOptions . port , "localhost" , function ( err , stats ) {
59
44
if ( err ) {
60
45
lastHash = null ;
0 commit comments