node.js - using StyleUrls or Styles within component of ng-seed/universal -


i can't seem figure out way component styles build correctly in browser , on server.

in webpack added following loader browserconfig object

module: {             rules: [         {           test: /\.css$/,           use: ['raw-loader']         }       ]     }, 

then component like

@component({     selector: 'create-account',     templateurl: 'create-account.template.html',     styleurls: ['create-account.css'],     providers: [createaccountservice], }) 

which build fine browser, on server build throws error.

error: ./src/client/components/security/account/create-account.css module parse failed: c:\users\josh.matthews\source\repos\universal\src\client\components\security\account\create-account.css unexpected token (1:1) may need appropriate loader handle file type. | .center_buttons { |     margin-left: auto; |     margin-right: auto; 

so went searching , found post

https://github.com/angular/universal/issues/564

which seems suggest need require styles. switch to

 @component({         selector: 'create-account',         templateurl: 'create-account.template.html',         styles: [require('./create-account.css')],         providers: [createaccountservice],     }) 

but still getting same error. seems loader isn't configured server, can't find separate server webpack config anywhere. how working>


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -