Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any react version template update ? #14

Open
hubingliang opened this issue Sep 6, 2021 · 1 comment
Open

Any react version template update ? #14

hubingliang opened this issue Sep 6, 2021 · 1 comment

Comments

@hubingliang
Copy link

No description provided.

@RoeelCohen
Copy link

RoeelCohen commented Nov 3, 2021

I would love to know as well. Here's what I got so far:

I started a simple react app using vite cli.
I followed with installing vite-plugin-chrome-extension
and updated the plugins with react as the first plugin:
plugins: [react(), chromeExtension()],

I moved the index.html file into the src folder.
To make sure I'm serving the right file in dev I added root: './src', to the vite config file. (Obv. I updated the script path inside the index.html file)

in the manifest.json I added the same index.html file path as the popup page:

"action": {
    "default_popup": "index.html",
    "default_title": "Rav Safe Browsing"
  },

I also added a background file inside src folder and in the manifest:

"background": {
    "service_worker": "background.js"
  },

Overall it seems to be working?
But I have few issues:

When running npm run dev I get the following errors:

Sourcemap for "/Users/roee/Repos/playground/SafeBrowsing/node_modules/.vite/react.js" points to missing source files
Sourcemap for "/Users/roee/Repos/playground/SafeBrowsing/node_modules/.vite/react_jsx-dev-runtime.js" points to missing source files
[BABEL] Note: The code generator has deoptimised the styling of /Users/roee/Repos/playground/SafeBrowsing/node_modules/.vite/react-dom.js?v=24bedd98 as it exceeds the max of 500KB.
Sourcemap for "/Users/roee/Repos/playground/SafeBrowsing/node_modules/.vite/react-dom.js" points to missing source files

I also didn't get to the options page yet so all in all it's not good enough solution and IDK if the basic standard react plugin can go hand in hand with this plugin :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants