Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hyrious/esbuild-plugin-style
The style-loader for esbuild.
https://github.com/hyrious/esbuild-plugin-style
Last synced: 17 days ago
JSON representation
The style-loader for esbuild.
- Host: GitHub
- URL: https://github.com/hyrious/esbuild-plugin-style
- Owner: hyrious
- License: mit
- Created: 2021-05-10T13:06:16.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-21T01:53:06.000Z (over 2 years ago)
- Last Synced: 2024-10-13T22:34:59.119Z (about 1 month ago)
- Language: TypeScript
- Size: 55.7 KB
- Stars: 23
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# @hyrious/esbuild-plugin-style
The missing style-loader for esbuild.
## Usage
```js
const { style } = require("@hyrious/esbuild-plugin-style");require("esbuild").build({
entryPoints: ["app.js"],
bundle: true,
outfile: "out.js",
plugins: [style()],
}).catch(() => process.exit(1));
```Given such app.js and style.css:
```js
import "./style.css";
console.log(1);
``````css
body { color: red; }
```Outputs (things like):
```js
let style = document.createElement("style");
style.append("body { color: red }");
document.head.append(style);
console.log(1);
```### Options
```ts
export function style({ minify = true, charset = "utf8" }): Plugin;
```## License
MIT @ [hyrious](https://github.com/hyrious)