There are no CSS maps after yarn build

After yarn build:production it works as expected.

After yarn build and yarn start there is no souce maps at public/styles

webpack.mix.js has the souceMaps function at the end of the file:


What else do I have to look at? Thanks!

It can well be that the sourcemap is writting inline into the output CSS file.
Does it work in the browser developer tools? Does it show the original source (SCSS) files and line numbers when inspecting styles?

1 Like

It doesn’t work and it doesn’t show the source files when inspect files. All styles are shown as it belongs to app.css?id=randomhash.

Also, Chrome has enabled CSS source maps.

Hm, this appears to be a bug with laravel-mix or of the webpack dependencies:

Does some of these workaround help (especially those at the end)?

Also this thread:

1 Like

wow! a bug from 2018?
reading workarounds

Solved adding this to css block:

 // webpack.mix.js
  devtool: 'source-map'

So, the entire block is:

  .sass('resources/styles/app.scss', 'styles')
  .sass('resources/styles/editor.scss', 'styles')
    devtool: 'source-map'
    processCssUrls: false,

This topic was automatically closed after 42 days. New replies are no longer allowed.