Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

docs: Emphasise that merge() doesn't accept webpack config objects #225

Merged
merged 1 commit into from
Jan 28, 2020

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Jan 3, 2020

The data structure that is passed to .merge() is very similar to a webpack configuration object, but has a few key differences.

The current docs don't make this clear enough, such that some users have been trying to pass the output of .toConfig() back to .merge(), which can cause errors:
#204 (comment)

The data structure that is passed to `.merge()` is very similar to a
webpack configuration object, but has a few key differences.

The current docs don't make this clear enough, such that some users
have been trying to pass the output of `.toConfig()` back to `.merge()`,
which can cause errors:
#204 (comment)
@edmorley edmorley added the docs label Jan 3, 2020
@edmorley edmorley self-assigned this Jan 3, 2020
@edmorley edmorley requested a review from a team January 3, 2020 11:58
@edmorley
Copy link
Member Author

edmorley commented Jan 3, 2020

@neutrinojs/core-contributors Hi!

In addition to the wording change currently in this PR, I was wondering about drastically simplifying the .merge() section of the docs, so that instead of being a copy-paste of every webpack config option, it only listed the areas where the data structure differed from the real webpack config schema (plus perhaps a few examples from the options that were identical).

ie:

  // Differences from webpack config

  plugin: {
    [name]: {
      plugin: WebpackPlugin,
      args: [...args],
      before,
      after
    }
  },

  // All other configuration is the same

  devServer: {
    [key]: value,

    // For example:
    port: 5000,
  },

This would save us having to constantly keep the options up to date (there are many already missing, and if I add them in, this section of the docs is going to get even longer), and perhaps make it more obvious to users what the differences are (and so what parts of the config they need to transform themselves first).

@edmorley
Copy link
Member Author

@neutrinojs/core-contributors (or anyone else) any thoughts on the above? :-)

@timkelty
Copy link

I was wondering about drastically simplifying the .merge() section of the docs, so that instead of being a copy-paste of every webpack config option, it only listed the areas where the data structure differed from the real webpack config schema (plus perhaps a few examples from the options that were identical).

Totally agree. Want to add that to your PR?

Copy link

@timkelty timkelty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM.
I'm in favor of truncating the .merge docs as mentioned as well.

@edmorley edmorley merged commit d34024d into master Jan 28, 2020
@edmorley edmorley deleted the edmorley-clarify-merge-docs branch January 28, 2020 09:33
@edmorley
Copy link
Member Author

I've split out the further example simplifications idea to #237 so that we can merge this in the meantime :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

2 participants