-
-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
The README says that this should work:
import {isContentScriptRegistered} from 'webext-dynamic-content-scripts/utils.js';
However, it refuses to import:
[commonjs--resolver] Missing "./utils.js" export in "webext-dynamic-content-scripts" package
As far as I can tell, this is due to the "exports" section of package.json not covering this file:
webext-dynamic-content-scripts/package.json
Lines 25 to 34 in d5ced5f
| "exports": { | |
| ".": { | |
| "types": "./distribution/index.d.ts", | |
| "default": "./distribution/index.js" | |
| }, | |
| "./including-active-tab.js": { | |
| "types": "./distribution/including-active-tab.d.ts", | |
| "default": "./distribution/including-active-tab.js" | |
| } | |
| }, |
I tried adding these lines to this section:
"./utils.js": {
"types": "./distribution/utils.d.ts",
"default": "./distribution/utils.js"
}and then the import immediately worked.
I'm no Javascript expert, but it seems a bit odd to be declaring each of these files manually in "exports". Can't it be done with a wildcard? And is there any reason not to re-export isContentScriptRegistered from index.ts, so that it can be imported directly from 'webext-dynamic-content-scripts'?
Metadata
Metadata
Assignees
Labels
No labels