Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler watchOptions are ignored in compiler.watch #125

Closed
pksjce opened this issue Sep 7, 2016 · 5 comments
Closed

compiler watchOptions are ignored in compiler.watch #125

pksjce opened this issue Sep 7, 2016 · 5 comments
Labels

Comments

@pksjce
Copy link

pksjce commented Sep 7, 2016

From @DarkPark on January 29, 2016 9:12

I have a compiler with watch options:

var compiler = webpack({
    ...
    watchOptions: { ... }
    ...
});

then I start watching:

compiler.watch(watchOptions, function ( error, stats ) {
    // why I should put watchOptions here again?
    // they are already set for compiler as described in documentation
});

it would be nice to be able to just start watching as it has all the necessary info:

compiler.watch(function ( error, stats ) {
    ...
});

or even without callback as I may not need error/stats info:

compiler.watch();

Copied from original issue: webpack/webpack#1951

@pksjce
Copy link
Author

pksjce commented Sep 7, 2016

From @sokra on January 30, 2016 8:53

You don't need the watchOptions in the configuration. You only need to provide it in the watch call.

watchOptions in configuration is only used by the CLI. Just like the devServer key which is only used by the dev server CLI.

@pksjce
Copy link
Author

pksjce commented Sep 7, 2016

From @DarkPark on January 30, 2016 9:17

@sokra quote from documentation:
"(only used when using CLI or simple node.js API)"
and I exactly use it in simple node.js API.

From architectural point of view maybe it's reasonable to split page configuration to a couple of config files.

@pksjce
Copy link
Author

pksjce commented Sep 7, 2016

From @sokra on January 30, 2016 10:52

yep thanks, I changed the documentation.

@pksjce
Copy link
Author

pksjce commented Sep 7, 2016

From @DarkPark on January 30, 2016 12:23

It is still confusing.
The whole page https://webpack.github.io/docs/configuration.html is clearly about the single configuration object passed to webpack.
It's rather strange to describe some options among compiler options but forbid to use these options for compiler.

@SpaceK33z
Copy link
Member

I think with the new docs in #204 this has been made pretty clear. At the top, it specifies how you can pass webpack-dev-server or webpack-dev-middleware options. watchOptions is also correctly documented there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants