Reputation: 783
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.
Upvotes: 7
Views: 1871
Reputation: 2653
Try this:
import 'select2/dist/js/select2.full.js'
I think this is the best you are going to get.
Upvotes: 9