New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sweetbuild

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sweetbuild

A collection of Broccoli macros for Sweet.js

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

sweetbuild npm version npm downloads Dependency Status WTFPL

A Sweet.js DSL for Broccoli, the best frontend asset pipeline.

Usage

$ npm install --save-dev sweet.js sweetbuild broccoli broccoli-merge-trees

Put the following in Brocfile.js:

require('sweet.js').loadMacro('sweetbuild');
module.exports = require('./Brocfile.sjs');

Put your build script in Brocfile.sjs (or whatever you required in Brocfile.js) and use Broccoli like you normally do.

The macros

brequire

A shorthand for require. Requires some_thing from broccoli-some-thing.

brequire source_map; // requires broccoli-source-map as source_map

+++ and +!+

Operators that merge trees using broccoli-merge-trees. They are left-associative. +!+ is the {overwrite: true} version. You can use both single trees and lists of trees at both sides.

var scripts = 'src' +++ 'vendor/src';
var styles = ['normalize', 'formalize'].map(function(x) {return 'bower_components/' + x}) +++ ['stylesheets', 'ie-stylesheets'] +!+ 'vendor/stylesheets';

->

The chain operator. Like the UNIX pipe for plugin calls. Best understood by example:

var scripts = 'src/main/coffee' -> coffee({bare: true}) -> uglify_js;
// same as:
var scripts = uglify_js(coffee('src/main/coffee', {bare: true}));

A complete example

brequire coffee;
brequire uglify_js;
brequire sass;
brequire manifest;

var scripts = 'vendor/js' +++ ('cs' -> coffee)
	-> uglify_js;

var styles = 'vendor/css' +++ ('vendor/sass' +++ 'sass'
	-> sass('main.scss', 'main.css'));

var assets = scripts +++ styles;

module.exports = assets +++ manifest(assets);

License

Copyright © 2014 myfreeweb This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details.

Keywords

sweet-macros

FAQs

Package last updated on 15 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts