LoginSignup
0
0

More than 3 years have passed since last update.

razzle start時にエラーログ出力させる

Last updated at Posted at 2020-02-07

はじめに

SSRを実現するビルドツール: razzlerazzle startでdevelopment modeで実行できるが、client/serverビルドに失敗しても、コンソールにログが表示されない。

デバッグしやすくするために、エラーログを表示させる方法をまとめました。

対応方法。

まず、friendly-errors-webpack-plugin - npm をインストール。

yarn add friendly-errors-webpack-plugin -D

razzle.config.js に以下を追記。エラーがあるファイルや内容を教えてくれるようになります。

// filename: razzle.config.js

'use strict';

// ココ
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');

module.exports = {
  plugins: [...],
  modify: (config, { target, dev }, webpack) => {
    // ココ
    config.plugins = [new FriendlyErrorsWebpackPlugin()];
    return config;
  }
};

本音としては、デフォルトで出力されてほしい。。

関連情報

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0