Content script nesting
Is this type of nesting supported? The content scripts here aren't being included when running
pnpm build
.2 Replies
Same issue is a problem for me too. Below plasmo config does not work. if the file name is different then "index.ts" in a nested contents file.
Why is that?
Is there solution for that?
src/contents/poshmark/crosslist.ts
import type { PlasmoCSConfig } from "plasmo"
import { runCrosslistHandler } from "~scripts/poshmark/crosslist-handler"
export const config: PlasmoCSConfig = {
matches: ["https://*.poshmark.com/*create-listing", "https://*.poshmark.ca/*create-listing"]
}
runCrosslistHandler()
it's just how plasmo does its discovery of which modules SHOULD be content scripts (vs something a content script imports) .. either use top-level modules (one per content script in the extension), or use the
index.ts(x)
or index.{browser}.ts(x)
under packages (one level of nesting only)