We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I need only native web-components without react libs in build file. Is it possible to do that? My Vite config:
import { defineConfig } from 'vite' export default defineConfig({ build: { // generate .vite/manifest.json in outDir manifest: true, rollupOptions: { // overwrite default .html entry input: '/src/index.jsx', }, }, })
index.jsx:
import ReactDOM from "react-dom/client" import r2wc from "react-to-webcomponent" import 'vite/modulepreload-polyfill' const Greeting = () => { return <h1>Hello, World!</h1> } const WebGreeting = r2wc(Greeting, React, ReactDOM) customElements.define("web-greeting", WebGreeting)
The text was updated successfully, but these errors were encountered:
Rollup has the option external to exclude files or dependencies from the bundle: https://rollupjs.org/configuration-options/#external
external
You can use something like this:
rollupOptions: { external: ['react'], output: { globals: { react: 'React', }, }, },
Sorry, something went wrong.
No branches or pull requests
I need only native web-components without react libs in build file. Is it possible to do that?
My Vite config:
index.jsx:
The text was updated successfully, but these errors were encountered: