11import { command } from 'yargs'
22import { take , tap } from 'rxjs/operators'
33import { logInfo } from '../utilities/log'
4- import { FuseBox , JSONPlugin , QuantumPlugin } from 'fuse-box'
4+ import {
5+ FuseBox ,
6+ JSONPlugin ,
7+ QuantumPlugin ,
8+ RawPlugin ,
9+ SassPlugin
10+ } from 'fuse-box'
511import { resolve } from 'path'
612import { NgProdPlugin } from '../fusebox/ng.prod.plugin'
713import { NgPolyfillPlugin } from '../fusebox/ng.polyfill.plugin'
814import { NgCompilerPlugin } from '../fusebox/ng.compiler.plugin'
915import readConfig_ from '../utilities/read-config'
16+ import { Ng2TemplatePlugin } from 'ng2-fused'
1017
1118command (
1219 'serve [port][prod][aot][sw]' ,
@@ -63,10 +70,22 @@ function serve(isProdBuild = false) {
6370 target : 'browser@es5' ,
6471 useTypescriptCompiler : true ,
6572 plugins : [
73+ Ng2TemplatePlugin ( ) ,
74+ [ '*.component.html' , RawPlugin ( ) ] ,
6675 NgProdPlugin ( { enabled : isProdBuild } ) ,
6776 NgCompilerPlugin ( { enabled : isAotBuild } ) ,
6877 NgPolyfillPlugin ( ) ,
6978 // NgOptimizerPlugin({ enabled: opts.enableAngularBuildOptimizer }),
79+ [
80+ '*.component.css' ,
81+ SassPlugin ( {
82+ indentedSyntax : false ,
83+ importer : true ,
84+ sourceMap : false ,
85+ outputStyle : 'compressed'
86+ } as any ) ,
87+ RawPlugin ( )
88+ ] ,
7089 isProdBuild &&
7190 QuantumPlugin ( {
7291 warnings : false ,
@@ -89,6 +108,18 @@ function serve(isProdBuild = false) {
89108 output : `${ serverOutput } /$name.js` ,
90109 plugins : [
91110 JSONPlugin ( ) ,
111+ Ng2TemplatePlugin ( ) ,
112+ [ '*.component.html' , RawPlugin ( ) ] ,
113+ [
114+ '*.component.css' ,
115+ SassPlugin ( {
116+ indentedSyntax : false ,
117+ importer : true ,
118+ sourceMap : false ,
119+ outputStyle : 'compressed'
120+ } as any ) ,
121+ RawPlugin ( )
122+ ] ,
92123 NgProdPlugin ( {
93124 enabled : true ,
94125 fileTest : 'server.angular.module.ts'
0 commit comments