robwormald / ng-universal-demo

256 stars 125 forks source link

about the universal server #7

Open z827101859 opened 7 years ago

z827101859 commented 7 years ago

in ./src/main.server.ts,why do you import AppServerModuleNgFactory but not AppServerModule ?

if I use import AppServerModule ,will it be replaced with AppServerModuleNgFactory by some tools automatically?

AntoineViau commented 7 years ago

Yes, AppServerModuleNgFactory is generated by the AOT compilation. You have to use ngc to produce the factories. These factories will build module, components and other stuff. See package.json in my fork of this project.

z827101859 commented 7 years ago

@AntoineViau in my project ,I use sass,like this:

@Component({
    selector: 'detail',
    templateUrl: './detail.component.html',
    styleUrls: ['./detail.component.scss']
})
export class DetailComponent {
    ...
}

if I use ngc to produce the factories,it will not process scss files and images.

MarkPieszak commented 7 years ago

You need to put in your scss loaders and such in the webpack config.