DEV Community

Cover image for JavaScript Quick Tip: Import from folder

JavaScript Quick Tip: Import from folder

Sunny Singh on January 12, 2019

Note: This article was originally written for my personal blog. I am republishing it here for the DEV community. Maintaining medium to large pro...
Collapse
 
beesnotincluded profile image
beesnotincluded

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.

Collapse
 
sunnysingh profile image
Sunny Singh

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?