Comments (9)
found the docs said The entries of options and popup pages are HTML files, their outputs are same as nomarl page.
link
its not a good solution that can import css as string, an then add to the document
such as I used the element-plus
, in your main.ts
import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import cssString from 'element-plus/dist/index.css'
const style = document.createElement('style');
document.head.append(style);
style.textContent = cssString;
createApp(App).use(ElementPlus).mount('#app')
from vite-plugin-chrome-extension.
@boka18 sorry, I can't find a solution by using this plugin. Now I change the plugin to this one and it works fine. The developer also provides a template to build extension with vite+vue+manifestV3.
from vite-plugin-chrome-extension.
Hey @Benbinbin, I have the exact same issue. Were you able to resolve it somehow?
from vite-plugin-chrome-extension.
got it @Benbinbin! thank you!
I was also able to create starter template for react (with this plugin)
You can check out the boilerplate here:
https://github.com/boka18/vite-react-chrome-extension-example
It's forked from here:
https://github.com/alvarosaburido/vite-vue-chrome-extension-example
In the above repo, it was built for vue. I managed to port that to react
from vite-plugin-chrome-extension.
same issue
from vite-plugin-chrome-extension.
I have the same problem with windicss import 'virtual:windi.css' in Svelte application popup. Css generates, but not link into HTML correctly
from vite-plugin-chrome-extension.
@reducm Thank you, that's worked for me
from vite-plugin-chrome-extension.
@reducm I'm not using ElementPlus, but after adding the other parts of your solution I'm still not getting Tailwind imported. When I inspect the popup DOM I don't see the <style>
element. Is ElementPlus adding some functionality for this to work for you?
from vite-plugin-chrome-extension.
@reducm I'm not using ElementPlus, but after adding the other parts of your solution I'm still not getting Tailwind imported. When I inspect the popup DOM I don't see the
<style>
element. Is ElementPlus adding some functionality for this to work for you?
to my knowledge, the elementPlus css
is just some css string, and I found it did add en style
tag to the document head
i think maybe some js code overwrite it, you code just use this code(remove other import) to see is there a style tag in head
import cssString from 'someCss'
const style = document.createElement('style');
document.head.append(style);
style.textContent = cssString;
from vite-plugin-chrome-extension.
Related Issues (20)
- Both package-lock.json and pnpm-lock.yaml in project
- validate manifest content_security_policy error HOT 1
- Add support for manifest v2
- Any react version template update ? HOT 1
- Not minifying
- Add support for DevTools HOT 1
- Content Scripts should not be IIFE HOT 1
- How do I run all the tests? HOT 1
- No sourcemaps HOT 1
- Missing Livereload HOT 3
- Permission Management detection misdetection HOT 3
- Cannot read property 'reduce' of undefined HOT 2
- Is this repo supposed to have no new commits? HOT 1
- This repo is unmaintained, see comment -> HOT 3
- move "vite" to peerDependencies
- Using CSS libraries
- Why popup page has no style? HOT 1
- Is there already a react example
- error in "content_security_policy" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-plugin-chrome-extension.