tldr;
How do I import a specific JS file from an npm package?
I'm fairly new to this whole package deal but it feels hard to find a guide for my case, so I'd like to ask the pros here.
In my PCF I've been able to install and use jquery using
npm install jquery
npm install @types/jqueryand
import $ from "jquery";So I feel like I got the basics.
A component that I'd like to use now is summernote, a WYSIWYG editor:
There's a version that uses Bootstrap, and there's a version that doesn't. I'm trying to use the one that doesn't. So first step I installed the package using
npm install summernoteThis created the summernote folder inside node_modules. And inside this summernote folder there are a couple files, one of them being the one for the version with BS (summernote.js) and one without (summernote-lite.js). Both create a new jquery extension called summernote and depending on which of these two JS files is being referenced it either uses the one with BS or the one without.
How do I tell my PCF which to use? While this statement compiles it obviously does not give the desired result:
import summernote from "summernote";What exactly does this line import and from where (as in: from which file exactly)? How do I import specifically the summernote-lite.js from the package called summernote?

Report
All responses (
Answers (