node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »

@strt/bricks

Bricks

Minimalistic build tool

npm version

Setup

Install it

$ yarn add --dev @strt/bricks
# or 
$ npm install --only=dev @strt/bricks 

and add scripts to your package.json

// package.json
{
  "scripts": {
    "dev": "bricks",
    "build": "bricks build"
  }
}

Commands

  • bricks Builds the project for development
  • bricks build Builds the project for production (minifies scripts, optimizes images etc)

Configuration

For custom configuration, create a bricks.config.js file in the root of your project directory.

// bricks.config.js
module.exports = {
  // Config options
}

Alternatively you can add the configuration in your package.json

// package.json
{
  "bricks": {
    // Config options
  }
}

Directories

{
  source: 'source',
  output: 'dist',
}

Styles

{
  styles: {
    path: 'styles',
    entries: ['./main.scss'],
  }
}

Scripts

Check Webpacks documentation for publicPath

{
  scripts: {
    path: 'scripts',
    entries: ['./main.js'],
    publicPath: '', 
  }
}

With named multiple or named enties

{
  scripts: {
    entries: {
      main: './main.js',
      polyfills: './polyfills.js',
    },
  }
}

BrowserSync

All options are sent forwarded directly to BrowserSync

{
  serve: {
    proxy: 'strateg.se',
    serveStatic: [
      {
        route: '/webdav/files/resources',
        dir: 'dist'
      }
    ]
  }
}

Browsers

To customize which browsers you want autoprefixer to prefix. Add a browserslist property to your package.json.

Babel

Add a .babelrc to your project root directory. Bricks will merge it with the built-in babel config.

// .babelrc
{
  "presets": ["@strt/bricks/babel"],
  "plugins": [
    "transform-decorators-legacy"
  ]
}