Skip to content
This repository was archived by the owner on Jul 27, 2021. It is now read-only.
This repository was archived by the owner on Jul 27, 2021. It is now read-only.

No errors when webpack config fails #71

@ThaNarie

Description

@ThaNarie

When your webpack config is invalid, it won't output to the console because quiet is true, but the plugin has not been 'applied'.

Error with quiet set to to false:

$ cross-env NODE_ENV=development webpack-dev-server --inline --progress --config build-tools/config/webpack/webpack.dev.conf.js
✖ 「wds」: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.output.filename: A relative path is expected. However the provided value "/asset/[name].js" is an absolute path!
   -> Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files.
   Please use output.path to specify absolute path and output.filename for the file name.
error Command failed with exit code 1.

Error with quiet set to true:

$ cross-env NODE_ENV=development webpack-dev-server --inline --progress --config build-tools/config/webpack/webpack.dev.conf.js
error Command failed with exit code 1.

Adding a log in the constructor and in the apply(compiler) { methods, only the constructor is executed.

So it seems there is a 'gap' before the plugin kicks in, where errors could happen, but don't get outputted because quiet needs to be set to true for this plugin to 'work'.

I'm not sure if there is a way to fix this, otherwise it would be good to clearly mention it in the readme/docs; when webpack exits without an error, temporarily disable the quiet mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions