Skip to content
/ pack Public

📦 Packs the assets for your web server.

License

Notifications You must be signed in to change notification settings

aerogo/pack

Repository files navigation

pack

Godoc Report Tests Coverage Sponsor

Packs the assets for your web server.

Installation

go get -u github.com/aerogo/pack/...

Usage

pack usage

Run pack in your project directory. It will scan your project directory recursively to compile .pixy, .scarlet and .js files resulting in a components package in your root directory. You can then import the components package in your project to access all of your assets.

Pack is silent by default. Use pack -v to produce verbose output.

Performance

Pack uses parallel compilation via job queues and is therefore extremely fast, much faster than the popular webpack.

Components

Since components is a generated directory you should list this directory in your .gitignore file.

CSS

import "github.com/YOUR_ORG/YOUR_REPO/components/css"
css.Bundle()

Returns the CSS bundle which is a string of CSS containing all styles.

JS

import "github.com/YOUR_ORG/YOUR_REPO/components/js"
js.Bundle()

Returns the JS bundle which is a string of JS containing all scripts.

Templates

import "github.com/YOUR_ORG/YOUR_REPO/components"

Templates are registered as public functions in the components package and can be called directly. All components are global, thus you can call a component from one file in another file without any import directives. Components return an HTML string but they use a single strings.Builder via pooling and streaming under the hood, which is extremely fast.

Style

Please take a look at the style guidelines if you'd like to make a pull request.

Sponsors

Cedric Fung Scott Rayapoullé Eduard Urbach
Cedric Fung Scott Rayapoullé Eduard Urbach

Want to see your own name here?