Giter Club home page Giter Club logo

Comments (11)

tonychandesign avatar tonychandesign commented on May 14, 2024

following up on this

I just noticed that some styles randomly just appeared within the inspect window- under injected stylesheet but it doesn't reference the actual style.scss.

The styles that show up are also outdated when compared to the source code... I've tried restarting the server but that didn't do anything

Oddly enough- uninstalling and reinstalling the extension did refresh the styles

I'm on the latest version btw

from chrome-extension-boilerplate-react-vite.

Jonghakseo avatar Jonghakseo commented on May 14, 2024

If you have written styles in the src/pages/content/style.scss file, you do not need to import that file in Demo/app.tsx.

This is what I have tried.

2023-04-20.10.59.55.mov

from chrome-extension-boilerplate-react-vite.

yavis1218 avatar yavis1218 commented on May 14, 2024

Hello, I understood your issue but can you share me your Webpack config?
I think this is a problem from webpack. some plugins are required.

from chrome-extension-boilerplate-react-vite.

pmorch avatar pmorch commented on May 14, 2024

This project uses vite, not webpack as far as I understand.

from chrome-extension-boilerplate-react-vite.

tonychandesign avatar tonychandesign commented on May 14, 2024

update on this- manually clicking the refresh button within chrome://extensions seems to fix the issue- but I'd assume this is still a bug since styles should be hot loading

from chrome-extension-boilerplate-react-vite.

imvedanshmehra avatar imvedanshmehra commented on May 14, 2024

Is there any way to load custom stylesheets that are placed outside of the src/pages/content directory?

from chrome-extension-boilerplate-react-vite.

Jonghakseo avatar Jonghakseo commented on May 14, 2024

@imvedanshmehra Have you tried importing in content/style.scss?

from chrome-extension-boilerplate-react-vite.

thucxuong avatar thucxuong commented on May 14, 2024

I'll give you an example to point to assets/style/index.css. I'm using tailwind btw.

You will need to adjust 2 files.

  1. In the vite.config.ts
    contentStyle: resolve(assetsDir, "style", "index.css"), this will point to assets/style/index.css
    assetFileNames, there is a logic to rename the css file. You can rename the generated css to something you desired, should contain hash key. In my case:
    I've changed this
if (name === "contentStyle") {
  return `assets/css/contentStyle${cacheInvalidationKey}.chunk.css`;
}

To this

if (name === "styleIndex") {
  return `assets/css/styleIndex${cacheInvalidationKey}.chunk.css`;
}
  1. You have to modify in the manifest.json file:
    Change from this
css: ["assets/css/contentStyle<KEY>.chunk.css"],

to this:

css: ["assets/css/styleIndex<KEY>.chunk.css"],

from chrome-extension-boilerplate-react-vite.

stale avatar stale commented on May 14, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from chrome-extension-boilerplate-react-vite.

stale avatar stale commented on May 14, 2024

ture

from chrome-extension-boilerplate-react-vite.

WalterZou avatar WalterZou commented on May 14, 2024

If you have written styles in the src/pages/content/style.scss file, you do not need to import that file in Demo/app.tsx.

This is what I have tried.

2023-04-20.10.59.55.mov

@Jonghakseo
I tested using your method, but the style @pages/content/style.scss didn't work. Only tailwind css worked.

from chrome-extension-boilerplate-react-vite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.