Puddinq.com sharing knowledge

Generate sourcemaps in twentynineteen for style.css

Generate sourcemaps in twentynineteen for style.css

If you dived into ‘How to compile WordPress 5.0 twentynineteen sass files you might mis the sourcemaps for the style.css. The sourcemaps are not generated by any of the commands without a small adjustment.

"scripts": {
    "build:style": "node-sass style.scss style.css --source-map true --output-style expanded && postcss -r style.css",
    "build:style-editor": "node-sass style-editor.scss style-editor.css --output-style expanded && postcss -r style-editor.css",
    "build:style-editor-customizer": "node-sass style-editor-customizer.scss style-editor-customizer.css --output-style expanded && postcss -r style-editor-customizer.css",
    "build:rtl": "rtlcss style.css style-rtl.css",
    "build:print": "node-sass print.scss print.css --output-style expanded && postcss -r print.css",
    "build": "run-p \"build:*\"",
    "watch": "chokidar \"**/*.scss\" -c \"npm run build\" --initial"
  }

In the line with build:style you need to add: style.css –source-map, just as done above.