relative-ci / roadmap

Issues, questions and feature requests for RelativeCI
https://relative-ci.com
3 stars 0 forks source link

Documentation typo for nextjs guide #33

Closed hboylan closed 2 years ago

hboylan commented 2 years ago

Just a small typo from copy-pasting the next.config.js webpack config.

https://relative-ci.com/documentation/guides/webpack-stats/next.js

// next.config.js
const { StatsWriterPlugin } = require('webpack-stats-plugin')

module.exports = {
  webpack: (config, options) => {
    const { dev, isServer } = options;

    // Output webpack stats JSON file only for client-side/production build
    if (!dev && !isServer) {
      config.plugins.push(
        new StatsWriterPlugin( // <-- missing curly braces for object
          filename: '../artifacts/webpack-stats.json',
          stats: {
            assets: true,
            entrypoints: true,
            chunks: true,
            modules: true
          }
        )
      );
    }

    return config;
  }
};
vio commented 2 years ago

Thank you @hboylan, fixed! 🙇

jessetan commented 1 year ago

Looks like you missed the closing curly brace :)

const { StatsWriterPlugin } = require('webpack-stats-plugin')

module.exports = {
  webpack: (config, options) => {
    const { dev, isServer } = options;

    // Output webpack stats JSON file only for client-side/production build
    if (!dev && !isServer) {
      config.plugins.push(
        new StatsWriterPlugin({
          filename: '../webpack-stats.json',
          stats: {
            assets: true,
            chunks: true,
            modules: true
          }
        ) // <-- should be })
      );
    }

    return config;
  }
};
vio commented 1 year ago

thanks for noticing it @jessetan, it is fixed now 🙇