![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
vite-plugin-bruh
Advanced tools
vite-plugin-bruh
- A vite plugin to integrate with bruhnpm i -D vite-plugin-bruh
or use npm init bruh
with the vite
template to quickly get started.
Example vite.config.mjs
file:
import { defineConfig } from "vite"
import bruh from "vite-plugin-bruh"
export default defineConfig({
plugins: [
bruh({
// Regex for the page render file extention
// Defaults to /\.html\.(mjs|jsx?|tsx?)$/
htmlRenderFileExtention,
// Absolute path of the root pages directory
// Defaults to vite's root
root,
// Options for the MDX compiler (xdm)
// Documentation at https://github.com/wooorm/xdm#compilefile-options
// e.g. for adding syntax highlighting by setting to { rehypePlugins: [ await import("@mapbox/rehype-prism") ] }
xdmOptions
})
]
})
This allows you to use the typical vite
for development and vite build
for production.
vite-plugin-bruh
will automatically allow you to prerender html files before vite sees them.
Here is an example project structure:
.
├── index.css
├── index.html.jsx
├── index.mjs
├── package-lock.json
├── package.json
└── vite.config.mjs
Upon a page request for /x
in dev:
x.html.mjs
(or x/index.html.mjs
, ...js/jsx/ts/tsx
) file is importedawait
edx.html
(or x/index.html
)At build time, all x.html.mjs
files are automatically included as entry points (as if they were x.html
)
If this is index.html.mjs
:
export default async () =>
`<!doctype html>
<html>
<head>
...
</head>
<body>
...
</body>
</html>
`
Vite sees this as if index.html
existed and contained:
<!doctype html>
<html>
<head>
...
</head>
<body>
...
</body>
</html>
During dev, vite will automatically and quickly reload the page as index.html.mjs
and its imports are edited.
This plugin automatically includes jsx support for bruh, meaning that you can freely write jsx content in both
render files (x.html.jsx
) and hydrate files (x.jsx
, what vite typically handles).
For MDX support, there is a workaround that replaces (in mdx files) any className
strings with class
.
You probably won't run into that problem before it is fixed in a more correct way, but it can be solved
by just writing "class" + "Name"
, "class\u004eame"
, className
or something similar.
FAQs
A vite plugin to integrate with bruh
The npm package vite-plugin-bruh receives a total of 0 weekly downloads. As such, vite-plugin-bruh popularity was classified as not popular.
We found that vite-plugin-bruh demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.