Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
esbuild-plugin-glsl-minify
Advanced tools
An esbuild plugin that adds support for .frag
, .vert
, .glsl
and .wgsl
file imports with optional shader minification.
npm install esbuild-plugin-glsl
import { build } from "esbuild";
import { glsl } from "esbuild-plugin-glsl-minify";
build({
entryPoints: ["input.js"],
outfile: "output.js",
bundle: true,
plugins: [glsl({
minify: true
})]
}).catch(() => process.exit(1));
To mangle and rename variables, you can use mangle
option. It is a primitive mangler that only renames variables and does not perform any optimizations. It respect the list of reserved words and attribute naming conventions. It is useful for obfuscating shaders. It only works together with minify
option.
import { build } from "esbuild";
import { glsl } from "esbuild-plugin-glsl-minify";
build({
entryPoints: ["input.js"],
outfile: "output.js",
bundle: true,
plugins: [glsl({
minify: true,
mangle: true
})]
}).catch(() => process.exit(1));
To make the TypeScript compiler know how to handle shader sources, add a shaders.d.ts
file to your project:
declare module "*.wgsl" {
const value: string;
export default value;
}
declare module "*.glsl" {
const value: string;
export default value;
}
declare module "*.frag" {
const value: string;
export default value;
}
declare module "*.vert" {
const value: string;
export default value;
}
Use the issue tracker to propose and discuss changes. Maintain the existing coding style. Lint and test your code.
FAQs
A GLSL plugin for esbuild.
We found that esbuild-plugin-glsl-minify 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.