create-vite-plugin-web-extension icon indicating copy to clipboard operation
create-vite-plugin-web-extension copied to clipboard

How to import element-plus css in a content script

Open wf-soft opened this issue 1 year ago • 1 comments

content_scripts: [
    {
      css:["../node_modules/element-plus/dist/index.css"],
      js: ["src/entries/contentScript/primary/main.ts"],
      matches: [ "https://mp.weixin.qq.com/*", "https://mmbiz.qpic.cn/*" ],
    },
  ],

image

wf-soft avatar May 05 '23 02:05 wf-soft

Is your node_modules directory actually one directory above your vite config? You could try defining a css file and importing the node_modules file within it. It's likely the plugin isn't resolving an input defined like that correctly.

samrum avatar May 05 '23 05:05 samrum