
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@web/dev-server-esbuild
Advanced tools
This package is still experimental. Let us know if you find any issues!
esbuild plugin for @web/test-runner-server and es-dev-server.
esbuild is a blazing fast build tool, and can be used to transform TS and JSX to JS. It can also transform modern JS to older JS for older browsers.
Install the package:
npm i -D @web/dev-server-esbuild
Create a es-dev-server.config.js
file:
const esBuildPlugin = require('@web/dev-server-esbuild');
module.exports = {
plugins: [esbuildPlugin({ ts: true })],
};
Create a web-test-runner.config.js
file:
const esBuildPlugin = require('@web/dev-server-esbuild');
module.exports = {
devServer: {
plugins: [],
},
};
We expose the following options for esbuild:
interface EsBuildPluginArgs {
target?: Target;
js?: boolean;
jsx?: boolean;
ts?: boolean;
tsx?: boolean;
jsxFactory?: string;
jsxFragment?: string;
define?: { [key: string]: string };
}
Some examples:
Typescript:
Transform all .ts files to javascript:
esbuildPlugin({ ts: true });
JSX:
Transform all .jsx files to javascript:
esbuildPlugin({ jsx: true });
By default, jsx
gets transformed to React.createElement calls. You can change this to the JSX style you are using.
For example when importing from preact like this:
import { h, Fragment } from 'preact';
esbuildPlugin({ jsx: true, jsxFactory: 'h', jsxFragment: 'Fragment' });
TSX
Transform all .tsx files to javascript:
esbuildPlugin({ tsx: true });
esbuildPlugin({ tsx: true, jsxFactory: 'h', jsxFragment: 'Fragment' });
JS
Transform JS to older versions of JS:
esbuildPlugin({ js: true, target: 'es2015' });
FAQs
Plugin for using esbuild in @web/dev-server
The npm package @web/dev-server-esbuild receives a total of 18,372 weekly downloads. As such, @web/dev-server-esbuild popularity was classified as popular.
We found that @web/dev-server-esbuild demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.