How to use @nuxt/friendly-errors-webpack-plugin - 2 common examples

To help you get started, we’ve selected a few @nuxt/friendly-errors-webpack-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github medfreeman / nuxt-netlify-cms-module / src / webpack.config.js View on Github external
// --------------------------------------
  if (nuxtOptions.dev) {
    // Add HMR support
    config.entry.app = [HMR_CLIENT, config.entry.app];

    config.plugins.push(
      new webpack.HotModuleReplacementPlugin(),
      new webpack.NoEmitOnErrorsPlugin(),
      // https://webpack.js.org/plugins/named-modules-plugin
      new webpack.NamedModulesPlugin()
    );

    // Add friendly error plugin
    if (!nuxtOptions.build.quiet && nuxtOptions.build.friendlyErrors) {
      config.plugins.push(
        new FriendlyErrorsWebpackPlugin({
          clearConsole: false,
          reporter: "consola",
          logLevel: "WARNING"
        })
      );
    }
  } else {
    // --------------------------------------
    // Production specific config
    // --------------------------------------
    // Minify and optimize the JavaScript
    config.plugins.push(
      // This is needed in webpack 2 for minify CSS
      new webpack.LoaderOptionsPlugin({
        minimize: true
      })
github nuxt / nuxt.js / packages / webpack / src / config / client.js View on Github external
})

    // Add HMR support
    if (this.dev) {
      config.entry.app.unshift(
        // https://github.com/webpack-contrib/webpack-hot-middleware/issues/53#issuecomment-162823945
        'eventsource-polyfill',
        // https://github.com/glenjamin/webpack-hot-middleware#config
        `webpack-hot-middleware/client?${hotMiddlewareClientOptionsStr}`
      )
    }

    // Add friendly error plugin
    if (this.dev && !quiet && friendlyErrors) {
      config.plugins.push(
        new FriendlyErrorsWebpackPlugin({
          clearConsole: false,
          reporter: 'consola',
          logLevel: 'WARNING'
        })
      )
    }

    return config
  }
}

@nuxt/friendly-errors-webpack-plugin

Recognizes certain classes of webpack errors and cleans, aggregates and prioritizes them to provide a better Developer Experience

MIT
Latest version published 6 months ago

Package Health Score

76 / 100
Full package analysis

Popular @nuxt/friendly-errors-webpack-plugin functions