js-dxtools/webpack-validator

devServer colors property not allowed when validating webpack.config.js

donnrri opened this issue ยท 10 comments

Hi

Including devServer{
contentBase:"./public",
historyApiFallback: true,
inline: true
colors: true
}
When the colors property is included, I get the error 'colors is not allowed' . Is this correct ? I thought the colors property was valid. Thanks

I think you're right. Do you see a difference in the webpack output when you include colors? Can you find a link to documentation or webpack code that utilizes the colors property?

Hi

Thanks for the quick response. Yes when I do not validate and have 'colors' I see warnings in yellow .
At the bottom of this page, colors is amoung the possible options https://webpack.github.io/docs/webpack-dev-server.html

Thanks for your time

Looks like we need to add it to this and add a test here. Would you be willing to makeapullrequest.com?

Sure , that would be great. I'll do it tomorrow.

I'll go through your eggheadio course first!

Hello Kent,

Just to let you know , had some issues with npm install for
webpack-validator on Windows 10 using Node V4.4.6 . Any help would be
appreciated.

First ,I kept getting an error installing node-pre-gyp.

Error:
node-pre-gyp ERR! Tried to download:
https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v46-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli@1.4.0 and
node@4.4.6 (node-v46 ABI) (falling back to source compile with node-gyp)

Googling suggested either removing compression-webpack-plugin or installing
python ( I chose the former option) and npm install worked OK.

Next I ran npm run validate
I needed to install npm-run-all, eslint and nyc (npm packages) to solve
some errors.

But I'm getting an error from lodash 'cannot find module
lodash/lang/cloneDeep' which is odd as lodash is installed correctly. If
you have any ideas how to fix that I'd be grateful.

Two other points , perhaps I should do a PR to update the contribution.md
to alert contributors to the npm packeges (nyc, eslint etc) I found I
required (?). Also do you and other contributors use Macs (I got the
impression my initial issue was a Windows related problem).

Sorry I cannot go any further today with this, but hope to get the PR done
tomorrow.

Regards and thanks for such a useful tool.

On Mon, Aug 1, 2016 at 4:59 PM, Kent C. Dodds notifications@github.com
wrote:

Looks like we need to add it to this
https://github.com/js-dxtools/webpack-validator/blob/f055505ac09f11323ca8dd250808d32809f4e4be/src/properties/devServer/index.js
and add a test here
https://github.com/js-dxtools/webpack-validator/blob/f055505ac09f11323ca8dd250808d32809f4e4be/src/properties/devServer/index.test.js.
Would you be willing to makeapullrequest.com?

โ€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#123 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB3IM18g62cBkLuT7VsbwdSMFTu9wrW-ks5qbhf3gaJpZM4JZh0u
.

Hey @donnrri,
Sorry you've been having trouble with this. I'm not certain what your problems are, but you shouldn't have to install extra packages. Running npm install in the project should give you everything you need. I'm guessing the reason you needed to install those other packages explicitly is because your original npm install failed. Could you try removing your node_modules folder and then running npm install again.

Also, what version of npm are you on? I recommend you get on the latest version 3.

Hi Kent,

OK will re-install. Im on npm V2.14.2 - will upgrade and see if that
works. Thanks for the email.

On Tue, Aug 2, 2016 at 3:46 PM, Kent C. Dodds notifications@github.com
wrote:

Hey @donnrri https://github.com/donnrri,
Sorry you've been having trouble with this. I'm not certain what your
problems are, but you shouldn't have to install extra packages. Running npm
install in the project should give you everything you need. I'm guessing
the reason you needed to install those other packages explicitly is because
your original npm install failed. Could you try removing your node_modules
folder and then running npm install again.

Also, what version of npm are you on? I recommend you get on the latest
version 3.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#123 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB3IMzz7qbFiQ84Wm_TFTNYTQRG1I5rxks5qb1gpgaJpZM4JZh0u
.

npm run validate will fail on windows until this is fixed

In case anyone else is seeing this issue, I've noticed that the "colors" attribute should be in the "stats" object.

devServer: {
        stats: {
            colors: true
        },
        contentBase: path.join({PATHNAME})
    }

This is slightly confusing, because you can use the --colors argument when running the CLI, and the documentation implies that these attributes can be included in the devServer object directly.