Losing most styling on build:production

So running into a weird issue where running yarn build:production removes most of my styling I’ve done.

Not sure if it’s because of a few lines I modified in the config files so that yarn build:production would actually finish. Ours was hanging at 94% asset optimization so I modified the following lines…

Removed the whole ImageminPlugin from webpack.config.optimize.

new ImageminPlugin({
      optipng: {optimizationLevel: 7},
      gifsicle: {optimizationLevel: 3},
      pngquant: {quality: '65-90', speed: 4},
      svgo: {removeUnknownsAndDefaults: false, cleanupIDs: false},
      plugins: [imageminMozjpeg({quality: 75})],
      disable: (config.enabled.watcher),
    }),

Set cache busting to always be false since the site was trying to load the non-hashed images for some reason. In config.js

  enabled: {
    sourceMaps: !isProduction,
    optimize: isProduction,
    cacheBusting: false,
    watcher: !!argv.watch,
  },

So now the site will actually build for production, and load the correct images. Not sure if removing the image min plugin is why the site was trying to load non-hashed ones. We have like 10+ Sage sites and this is the newest one, only one that hangs on Asset Optimization.

With the site building for production now though, we’re losing most of our styling. Not sure what’s going on.

Any chance it’s related to this? https://github.com/roots/sage/issues/2017

2 Likes