flyntwp / flynt

Component based WordPress starter theme, powered by ACF Pro and Timber, optimized for a11y and fast page load results.
https://flyntwp.com
MIT License
735 stars 84 forks source link

How to enable Sourcemaps for sass #389

Closed koraysels closed 3 years ago

koraysels commented 3 years ago

How can we get sourcemaps for the styles?

is there a setting somewhere?

domtra commented 3 years ago

Hi @koraysels ,

what exactly are you trying to achieve? Source-Maps in production, ie after running npm run build? Or source maps for SCSS?

The first one you can achieve by changing the devtool option in webpack.config.js. This is set to false for production. You can see the options here.

Getting the source map to work completely with scss in development, I have not been able to achieve. In theory adding sourceMap: true to all loader options in the test: /\.scss$/, modules and adding importLoaders: 2 to the css-loader should do the trick. But for me this only lead to some partials (like _base.scss) being displayed correctly. For the components' styles this did not work.