0

I have an Angular app which uses Universal SSR and I've noticed that HomeComponent which contains scss is not compressed when I have it uploaded and rendered on a node.js server. The matter is that I have the scss compressed at my home.component.scss source file. Does Webpack do this? Not too sure.

So how do I have my component's scss file compressed while being rendered on a node.js server.

I've attached two images. One is the app's HomeCompnent scss source file, the other is a server-rendered rendered page.

Compressed scss

SCSS not compressed at a rendered page

Angry Beaver
  • 415
  • 1
  • 6
  • 18
  • Sorry, I don't know what to tell you. I just downloaded a seed ssr project from the GitHub and used is for my project. What exactly do you need to know, configuration of what? – Angry Beaver Oct 11 '19 at 13:31
  • Did you add BrowserModule.withServerTransition({ appId: }) ? – Shikha Oct 11 '19 at 13:37
  • Yes, I have the "BrowserModule.withServerTransition({appId:'angular-starter'})" in the app.module.ts imports array. – Angry Beaver Oct 11 '19 at 13:46
  • Are you sure your second image hasn't had a sourcemap applied to it? – MikeOne Oct 11 '19 at 14:12
  • MikeOne, to be honest I don't know it, Ima newbie. How do I check it? – Angry Beaver Oct 11 '19 at 14:43
  • MikeOne, you're quite right! There's the base46 decoded text below the uncompressed css. But...this means that a server is just rendering duplicated css or Webpack does this upon making a build, rigth? – Angry Beaver Oct 11 '19 at 15:07
  • As it turned out it's possible to turn off this mapping by adding the line below to the angular.json: "server": { "options": { "sourceMap": false }, – Angry Beaver Oct 23 '19 at 09:04

0 Answers0