How to pass .env file variables to webpack config?

You can use dotenv package for this purpose. npm install dotenv –save After installing the package, add this in the top of your config: const webpack = require(‘webpack’); // only add this if you don’t have yet // replace accordingly ‘./.env’ with the path of your .env file require(‘dotenv’).config({ path: ‘./.env’ }); then in plugins … Read more

Typescript react – Could not find a declaration file for module ”react-materialize’. ‘path/to/module-name.js’ implicitly has an any type

I had a similar error but for me it was react-router. Solved it by installing types for it. npm install –save @types/react-router Error: (6,30): error TS7016: Could not find a declaration file for module ‘react-router’. ‘\node_modules\react-router\index.js’ implicitly has an ‘any’ type. If you would like to disable it site wide you can instead edit tsconfig.json … Read more