Closed vjancik closed 8 years ago
Good point.
I think I'll rethink the validator configuration so that we'll get a npm script to run. The validator includes a cli so we'll end up with something like "test:validate": "webpack-validator"
though there's the problem of digging out the configuration paths to validate (needs development on validator side).
There can also be a flag so you could do something like VALIDATE=true npm start
so that validation becomes opt-in.
Thanks for the report again. 👍
Good point. Well that option would be easy to implement. Care to PR? Should probably be called "quiet", no?
@jonathanewerner Yeah, I will PR quiet
. Easy enough.
I just merged the PR from @bebraw. webpack-validator has now a new option 'quiet'
Quiet Mode If you want to mute console output apart from errors, set --quiet or validate(config, yourSchema, {quiet: true}). This is particularly useful if you are using webpack --json as you'll want to avoid writing additional text to the JSON output.
I opened two new related issues: https://github.com/js-dxtools/webpack-validator/issues/72, https://github.com/js-dxtools/webpack-validator/issues/73 . We can do a little better. 👍
http://survivejs.com/webpack/building-with-webpack/analyzing-build-statistics/ Validate config plugin adds this line to the top of stats.json file:
[webpack-validator] Config is valid.
and makes the
stats.json
file invalid for use with the online tool (unless you remove the first line). Didn't try the standalone tool.Not sure what's the easiest fix, maybe piping the output in
package.json
to some linux text util to remove the first line, then piping it tostats.json