Skip to content

Instantly share code, notes, and snippets.

View y-developer's full-sized avatar
🎯
Focusing

Yasitha Nadeeshan y-developer

🎯
Focusing
  • Anuradhapura, Sri Lanka.
View GitHub Profile
@hyrious
hyrious / esbuild-plugin-styled-components.js
Created October 20, 2021 03:09
esbuild plugin styled-components
import babel from '@babel/core'
import styled from 'babel-plugin-styled-components'
import fs from 'node:fs'
export default {
name: "styled-components",
setup({ onLoad }) {
const root = process.cwd();
onLoad({ filter: /\.[tj]sx$/ }, async (args) => {
let code = await fs.promises.readFile(args.path, "utf8");