A recent update to crypto-js library switches to using native crypto module of the underlying OS, as I understand it.
As a result, my build fails (verbose output below) if I use the updated version, as it seems it is not wired in the default Angular webpack config.
How to make crypto-js
find it?
This comment is enlightning, but I don't know enough of the underlying libraries concepts to navigate by myself.
WARNING in ./node_modules/crypto-js/core.js
Module not found: Error: Can't resolve 'crypto' in '/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules/crypto-js'
resolve 'crypto' in '/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules/crypto-js'
Parsed request is a module
using description file: /tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules/crypto-js/package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
looking for modules in /tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8
using description file: /tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration
using description file: /tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/package.json (relative path: ./crypto)
no extension
Field 'browser' doesn't contain a valid alias configuration
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/crypto doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/crypto.ts doesn't exist
.tsx
Field 'browser' doesn't contain a valid alias configuration
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/crypto.tsx doesn't exist
.mjs
Field 'browser' doesn't contain a valid alias configuration
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/crypto.mjs doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/crypto.js doesn't exist
as directory
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/crypto doesn't exist
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules/crypto-js/node_modules doesn't exist or is not a directory
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules/node_modules doesn't exist or is not a directory
/tmp/node_modules doesn't exist or is not a directory
/node_modules doesn't exist or is not a directory
looking for modules in /tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules
using description file: /tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
using description file: /tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/package.json (relative path: ./node_modules/crypto)
no extension
Field 'browser' doesn't contain a valid alias configuration
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules/crypto doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules/crypto.ts doesn't exist
.tsx
Field 'browser' doesn't contain a valid alias configuration
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules/crypto.tsx doesn't exist
.mjs
Field 'browser' doesn't contain a valid alias configuration
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules/crypto.mjs doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules/crypto.js doesn't exist
as directory
/tmp/build_fa83cfc445ddeaf2cca1c12ae9bcefc8/node_modules/crypto doesn't exist