DEV Community

Discussion on: JavaScript Quick Tip: Import from folder

beesnotincluded profile image

Did you get this to work properly with webpack 4 and production build mode? When i tried this recently webpack failed to notice that these imports were in use and removed them from the production build.

sunnysingh profile image
Sunny Singh Author

That is a really weird case scenario. I didn't have any issues with the latest version of Next.js, which should be using latest Webpack as well. Are you using babel-preset-env and Node v8 or newer?