This plugin helps you bundling files using ESBuild. This plugin does not handle Gjs detail for you, you can use esbuild-gjs to handle that.
import * as esbuild from "esbuild";
import GjsPlugin from "esbuild-gjs";
import GSolidPlugin from "esbuild-plugin-gsolid";
await esbuild.build({
entryPoints: ["index.tsx"],
target: "firefox68", // Spider Monkey 68
format: "esm",
bundle: true,
outfile: "dest/index.js",
plugins: [GjsPlugin({}), GSolidPlugin()],
treeShaking: true,
});
You must install babel-preset-solid together to use this plugin.
# NPM:
npm i --save-dev esbuild-plugin-gsolid babel-preset-solid
# PNPM:
pnpm -D esbuild-plugin-gsolid babel-preset-solid
# YARN
yarn add -D esbuild-plugin-gsolid babel-preset-solid
# BUN
bun add -D esbuild-plugin-gsolid babel-preset-solid
- Load tsx/jsx files and transform them into JavaScript
- Resolve solid-js package as "solid-js-file" namespace, load files and inject
gsolid/web-ponyfill
into them - Assume your code files are UTF-8 encoding
SPDX: Apache-2.0