Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
esbuild-plugin-solid
Advanced tools
Plugin to compile solid-js jsx components with esbuild.
/!\ Disclaimer /!\
At the time of writing this, esbuild
is not AS performant in term of dead code elimination as rollup
is.
Rollup is the preferred way to bundle solid apps as it generally produce smaller code.
In my tests, a hello world :
rollup
: 5.95kbesbuild
: 9.65kbsolid-js
and esbuild
are peer dependencies
# For npm
npm install solid-js
npm install -D esbuild esbuild-plugin-solid
# For pnpm
pnpm add solid-js
pnpm add -D esbuild esbuild-plugin-solid
# For yarn
yarn add solid-js
yarn add -D esbuild esbuild-plugin-solid
Once installed you need to configure esbuild
to use this plugin.
const { build } = require('esbuild');
const { solidPlugin } = require('esbuild-plugin-solid');
build({
entryPoints: ['app.jsx'],
bundle: true,
outfile: 'out.js',
plugins: [solidPlugin()],
}).catch(() => process.exit(1))
There's no configuration as of now.
This is a 30 lines of code plugin. All it does is parse every import source code, check if JSX syntax is present using a dumb regex and transforming the file with @babel/core
, @babel/preset-typescript
and babel-preset-solid
.
Out of the box it checks every /(t|j)sx?/
files and only transforms the one with JSX syntax in it.
This package uses pnpm so you might want to install it if you don't have it.
Once done, you can just pnpm build
& pnpm test
to build & test your changes.
pnpm test
will build a dumb module with the plugin and open a local web server serving the tests
folder for you to check if things still work.
0.4.2 (2021-12-24)
<a name="0.3.1"></a>
FAQs
Solid's integration for ESBuild
The npm package esbuild-plugin-solid receives a total of 5,096 weekly downloads. As such, esbuild-plugin-solid popularity was classified as popular.
We found that esbuild-plugin-solid demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.