I’ll chime in here too: perhaps it helps someone.
I found that when I had issues with certain imports, I was able to solve it by importing specific files (check node_modules which ones you want) such as with this scenario:
-
Adding external library: in your theme root
yarn add magnific-popup
-
In your relevant stylesheet scss below
@import "./autoload/**/*";
:
@import "~magnific-popup/dist/magnific-popup.css";
-
In your relevant script file on top:
import 'magnific-popup/dist/jquery.magnific-popup.js';