I am using the ES2016 import syntax to load the select2 libray from an npm module (via Webpack):
import 'select2';
This works fine and loads the following file from the node_modules directory.
node_modules/select2/dist/js/select2.js
Now within that directory they have a full version of the library which has some extra functionality I need, it is called:
node_modules/select2/dist/js/select2.full.js
Is there a way to import this without providing the full relative path to my node_modules folder?
I tried:
import 'select2.full'
but no luck.
Try this:
import 'select2/dist/js/select2.full.js'
I think this is the best you are going to get.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With