Code Monkey home page Code Monkey logo

Comments (2)

coreyleelarson avatar coreyleelarson commented on June 5, 2024 2

How is this supposed to work?

I included this plugin for each of my configs, which are exported as an array to the webpack multicompiler. When webpack runs, I see logs for each config, sometimes a mix of success and error depending on the compiler results.

This can be extremely confusing if clearConsole: true since there's a possibility that I could see nothing but a [DONE] Compiled successfully in XXXms message for one config when there could be an error in another.

webpack.config.babel.js

import clientConfig from './webpack.config.client.babel';
import serverConfig from './webpack.config.server.babel';

export default [clientConfig, serverConfig];

webpack.config.base.babel.js

import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';

export default {
  stats: 'none',
  module: {
    rules: [
      {
        test: /\.js?$/,
        use: 'babel-loader',
        exclude: /node_modules/
      }
    ]
  },
  plugins: [
    new FriendlyErrorsPlugin({
      clearConsole: false
    })
  ]
}

webpack.config.client.babel.js

import path from 'path';
import webpackMerge from 'webpack-merge';
import baseConfig from './webpack.config.base.babel';

export default webpackMerge(baseConfig, {
  target: 'web',
  name: 'client',
  entry: {
    client: './client/client.js'
  },
  output: {
    path: path.resolve('./build/assets'),
    filename: 'scripts/[name].bundle.js'
  }
});

webpack.config.server.babel.js

import path from 'path';
import webpackMerge from 'webpack-merge';
import nodeExternals from 'webpack-node-externals';
import baseConfig from './webpack.config.base.babel';

export default webpackMerge(baseConfig, {
  target: 'node',
  name: 'server',
  externals: [nodeExternals()],
  entry: {
    server: './server/server.js'
  },
  output: {
    path: path.resolve('./build'),
    filename: '[name].bundle.js'
  }
});

from friendly-errors-webpack-plugin.

geowarin avatar geowarin commented on June 5, 2024

Yes, see #9

from friendly-errors-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.