-
I am using tom-select via npm and Webpack -- actually with Rails webpacker. This works swimingly, if I do something like:
Great! Or, of course, I can load But wouldn't it be nice if there were a way to load base, and then import specific plugins individually to include them, all in webpacker via npm source, without having to make a custom build via source and grunt? Maybe there is, and I'm missing it -- I am very far from an expert or even very comfortable with webpack(er) at this point -- but I don't think so. If I try, say,
I didn't really expect that to work anyway -- the second import wouldn't necessarily interact with the first one to actually add the plugin, because of how webpack works (I sort of kind of think/understand). But also it produces an error on webpack compilation, that I don't understand at all:
I think the JS in the npm package would have to be changed/refactored somehow to make this possible, to make it possible to import specific plugins at webpack compilation time from npm source. So I think this is a feature request. I don't really understand JS and what's going on well enough to say exactly how it could/should be done. Any thoughts? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
OK, I figured it out... only cause I started randomly reading closed Issues in this project, and found this one: So this works!
So there could be some things I am just missing here. But I wonder if there should be docs on how to import in this environment (which I think is not just limited to webpack? I don't even know what to call this style/kind of environment!) somewhere, including the base/plugins example? |
Beta Was this translation helpful? Give feedback.
-
I am running into this too and posted another suggestion here: #222 |
Beta Was this translation helpful? Give feedback.
-
Rats, I hadn't noticed, but I believe you. (It's a bit tricky for me to even figure out to confirm/deny, honestly). That would kind of defeat the purpose of the plugins. Would love to see that fixed. |
Beta Was this translation helpful? Give feedback.
OK, I figured it out... only cause I started randomly reading closed Issues in this project, and found this one:
#57
So this works!
/dist/esm
, not./dist/js
. I honestly don't know how I would have figured this out if I hadn't found the exact example. I don't know whatesm
stands for or how it differs from./dist/js
. . I generally don't understand how I am supposed to figure out the right way/place toimport
from any npm packages, not just this one, I feel lost every time!So there could be some things I am just missing here.
But I wonder if there should be docs on h…