https://github.com/activeguild/esbuild-plugin-prismjs
A PrismJS plugin for esbuild. Bundle the language and plugins set in the configuration at build time. The same options as babel-plugin-prismjs are available.
https://github.com/activeguild/esbuild-plugin-prismjs
esbuild esbuild-plugin prismjs
Last synced: 12 months ago
JSON representation
A PrismJS plugin for esbuild. Bundle the language and plugins set in the configuration at build time. The same options as babel-plugin-prismjs are available.
- Host: GitHub
- URL: https://github.com/activeguild/esbuild-plugin-prismjs
- Owner: activeguild
- License: mit
- Created: 2022-01-07T08:22:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-05T13:09:25.000Z (about 3 years ago)
- Last Synced: 2025-02-21T11:07:46.699Z (about 1 year ago)
- Topics: esbuild, esbuild-plugin, prismjs
- Language: TypeScript
- Homepage:
- Size: 328 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
esbuild-plugin-prismjs ⚡ Welcome 😀
If you are using babel, please use [babel-plugin-prismjs](https://www.npmjs.com/package/babel-plugin-prismjs).
## Introduce
A [PrismJS](https://github.com/PrismJS/prisms) plugin for esbuild.
Bundle the language and plugins set in the configuration at build time.
The same options as [babel-plugin-prismjs](https://www.npmjs.com/package/babel-plugin-prismjs) are available.
## Install
```bash
npm i -D esbuild-plugin-prismjs
```
## Usage
```bash
import { prismjsPlugin } from 'esbuild-plugin-prismjs'
import { build } from 'esbuild'
build({
entryPoints: ['./src/index.ts'],
outdir: 'dist',
bundle: true,
minify: true,
platform: 'node',
plugins: [
prismjsPlugin({
inline: true,
languages: ['typescript', 'javascript', 'css', 'markup'],
plugins: [
'line-highlight',
'line-numbers',
'show-language',
'copy-to-clipboard',
],
theme: 'okaidia',
css: true,
}),
],
}).catch(() => process.exit(1))
```
## Options
A plugin option is [babel-plugin-prismjs](https://www.npmjs.com/package/babel-plugin-prismjs) and you can use the same option.
#### Original Options
| Property | Type | Description |
| -------- | ------- | ------------------------------------ |
| inline | boolean | Embed the css inline. (default true) |
## Principles of conduct
Please see [the principles of conduct](https://github.com/activeguild/visualize-react-component/blob/master/.github/CONTRIBUTING.md) when building a site.
## License
This library is licensed under the [MIT license](https://github.com/activeguild/visualize-react-component/blob/master/LICENSE).