This plugins watches and builds the source files continiusly in-memory

Overview

Caddy Esbuild plugin

This plugins watches and builds the source files continiusly in-memory. It includes a etag to cache in the browser to save bandwidth.

Features:

  • Live reload (v0.1.0)
  • SASS (v0.2.2)
  • Manifest.json (v0.3.0) /<target>/manifest.json, defaults to /_build/manifest.json
  • Env support (v0.4.0)
  • Multiple entrypoint (v0.5.0) (filename must be different)
  • Refactor to routes (v0.5.0) (route /_build {esbuild assets/index.js env auto_reload sass})
  • Custom loader configuration (v0.6.0)
  • Enable hashed files with file_hash property (v0.7.0)
  • Enable defines (v0.8.0)
  • Ouptut alias (v0.9.0)

Configuration:

Caddyfile:

{
  order esbuild first
}

localhost:8080 {
  file_server  {
    root example/public
  }
  esbuild {
    env
    sass
    live_reload
    target /_build
    source ./example/src/index.js
    source ./example/src/index.css global
    loader .png dataurl
    loader .svg file
    loader .json json
    loader .js jsx
    define global window
  }
}

or a simplified version:

{
  order esbuild first
}

localhost:8080 {
  file_server  {
    root example/public
  }
  esbuild ./example/src/index.js live_reload sass env ./example/src/index2.js
}

Documentation:

  • Env support: It will scan any .env, .env.<NODE_ENV>, .env.local, .env.<NODE_ENV>.local, and the runtime environment for relevant variables.
    It will however not watch them changes or auto-reload them.

Devlopment:

To run: xcaddy run -watch

Build caddy with:

# To enable sass:
CGO_ENABLED=1 xcaddy build --with github.com/richard87/caddy-esbuild-plugin

#without sass:
xcaddy build --with github.com/richard87/caddy-esbuild-plugin
You might also like...
GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.
Squzy - is a high-performance open-source monitoring, incident and alert system written in Golang with Bazel and love.

Squzy - opensource monitoring, incident and alerting system About Squzy - is a high-performance open-source monitoring and alerting system written in

Open Source HTTP Reverse Proxy Cache and Time Series Dashboard Accelerator
Open Source HTTP Reverse Proxy Cache and Time Series Dashboard Accelerator

Trickster is an HTTP reverse proxy/cache for http applications and a dashboard query accelerator for time series databases. Learn more below, and chec

Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.
Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.

Connecting the Next Billion People Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core

mysshw - a free and open source ssh cli client soft.

mysshw install go version = 1.16.* use go get go get -u github.com/cnphpbb/mysshw go version = 1.17.* use go install go install github.com/cnphpbb/

Event Source for Direktiv and Knative

Event Source for Direktiv and Knative This repository contains ContainerSources for Knative Eventing. The following sources are available: Direktiv (I

Hybridnet is an open source container networking solution, integrated with Kubernetes and used officially by following well-known PaaS platforms

Hybridnet What is Hybridnet? Hybridnet is an open source container networking solution, integrated with Kubernetes and used officially by following we

Openp2p - an open source, free, and lightweight P2P sharing network
Openp2p - an open source, free, and lightweight P2P sharing network

It is an open source, free, and lightweight P2P sharing network. As long as any device joins in, you can access them anywhere

The source code, deployment manifests and CI/CD pipelines for the taxi application

The Taxi App About This repository contains the source code, deployment manifests and CI/CD pipelines for the taxi application. Application Source cod

Owner
Richard Hagen
Richard Hagen
Provides agent and server plugins for SPIRE to allow Tailscale node attestation.

SPIRE Tailscale Plugin ⚠️ this node attestation plugin relies on a Tailscale OIDC id-token feature, which is marked as Work-in-Progress and may not be

Johan Siebens 9 May 22, 2022
pb: a tool for managing protoc builds and dependencies

pb pb is a Protocol Buffers Build tool that manages dependencies and build confi

Dan Enman 3 Nov 20, 2022
Package for writing Nagios/Icinga/et cetera plugins in Go (golang)

nagiosplugin Package for writing Nagios/Icinga/et cetera plugins in Go (golang). Documentation See http://godoc.org/github.com/olorin/nagiosplugin. Us

Sharif Olorin 71 Aug 30, 2022
Snap builds for CalyxVPN

Install snap sudo snap install riseup-vpn --classic You can track beta channel,

LEAP Encryption Access Project 0 Dec 20, 2021
Provides the function Parallel to create a synchronous in memory pipe and lets you write to and read from the pipe parallelly

iopipe provides the function Parallel to create a synchronous in memory pipe and lets you write to and read from the pipe parallely

Ozgur Erdem 0 Jan 25, 2022
llb - It's a very simple but quick backend for proxy servers. Can be useful for fast redirection to predefined domain with zero memory allocation and fast response.

llb What the f--k it is? It's a very simple but quick backend for proxy servers. You can setup redirect to your main domain or just show HTTP/1.1 404

Kirill Danshin 13 Sep 27, 2022
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http

fasthttp Fast HTTP implementation for Go. Currently fasthttp is successfully used by VertaMedia in a production serving up to 200K rps from more than

Aliaksandr Valialkin 18.9k Jan 5, 2023
In memory Key/Value store in go using gRPC.

In memory cache, using gRPC Contents About Running Server Local Docker Kubernetes Example Helm Terraform API Add Get GetByPrefix GetAllItems DeleteKey

Kautilya Tripathi 144 Dec 26, 2022
A memory-safe SSH server, focused on listening only on VPN networks such as Tailscale

Features Is tested to work with SCP Integrates well with systemd Quickstart Download binary for your architecture. We only support Linux. If you don't

function61.com 2 Jun 10, 2022