[SOLVED] No sourcemap with PostCSS (0.46)

PostCSS sourcemaps are indeed possible with Hugo Pipes. From my experience it’s best to ignore the PostCSS options Hugo Pipes offers and just use a postcss.config.js file. Setting map: { inline: true } there should embed the sourcemap into your style file:

module.exports = {
  map: { inline: true },
  plugins: {
    ...
  }
};

If you want to configure PostCSS the Hugo Pipes way with postCSS (dict "noMap" false) you’d have to use a separate config file anyway according to the postcss-cli maintainers: “If you want to set options via CLI, it’s mandatory to reference ctx.options in postcss.config.js”.

module.exports = ctx => ({
  map: ctx.options.map,
  plugins: {
    ...
  }
});
1 Like