Packs the assets for your web server.
go get -u github.com/aerogo/pack/...
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.
Pack uses parallel compilation via job queues and is therefore extremely fast, much faster than the popular webpack.
Since components
is a generated directory you should list this directory in your .gitignore
file.
import "github.com/YOUR_ORG/YOUR_REPO/components/css"
css.Bundle()
Returns the CSS bundle which is a string of CSS containing all styles.
import "github.com/YOUR_ORG/YOUR_REPO/components/js"
js.Bundle()
Returns the JS bundle which is a string of JS containing all scripts.
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.
Please take a look at the style guidelines if you'd like to make a pull request.
Cedric Fung | Scott Rayapoullé | Eduard Urbach |
Want to see your own name here?