Strange problem but I'm sure it's easily solved. I've tested on a completely empty webpack project.
It says npm js-cookie has 0 dependencies so I guess this should work on its own.
$ npm install js-cookie --save
Then simply ran this in my script file.
require('js-cookie');
Cookies.set('name', 'value');
The node vendor js-cookie
100% exists and no errors on the require.
However just get this error.
Heres a test project you can download and spin up using npm install
and then npm run production
to see error.
http://dev.joshmoto.wtf/npm-webpack-jscookie-project.zip
I'm using laravel mix but I don't see how that can be a the problem?
global.Cookies = require('js-cookie');
in order for it to work in my other required js files. But i get the idea now. – Palinode