ucompiler

Universal assets compiler

Use pundle-cli instead
Last updated 4 years ago by steelbrain .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ucompiler 
SYNC missed versions from official npm registry.

UCompiler

UCompiler is the next generation assets manager. It's built to be extended and provides an easy-to-use plugin API.

Installation

Installing UCompiler is easy, just execute this in a terminal

npm install -g ucompiler

Configuration

UCompiler is extremely customizable and hackable to the core. It can be configured with it's JSON configuration file written as .ucompiler.

Here's an example ucompiler configuration for a project using less and babel plugins

{
  "defaultRule": "compile-babel",
  "rules": [{
    "name": "compile-babel",
    "plugins": ["babel"],
    "babel": {
      "presets": ["steelbrain"]
    },
    "include": [{
      "directory": "src",
      "extensions": ["js"]
    }],
    "outputPath": "scripts/{relativePath:4}"
  }, {
    "name": "compile-less",
    "plugins": ["less"],
    "include": [{
      "directory": "src",
      "extensions": ["less"]
    }],
    "exclude": ["vendor/**/*.less"],
    "outputPath": "styles/{relativePath:7}",
    "sourceMapPath": "styles/{relativePath:7}"
  }]
}

Usage

UCompiler has two valid CLI commands

  • ucompiler go [rule]
  • ucompiler watch [rule]

Plugin API

The names of plugin package should start with ucompiler-plugin-. However you can drop that part in your configuration file. The plugin interface is written below. If you don't want to perform any customizations on the string, simply return null from your package.

type UCompilerJob = shape {
  rootDirectory: string,
  filePath: string,
  state: Object,
  config: Object
}

type UCompilerResult = shape {
  contents: string,
  sourceMap?: ?{
    sources: Array<string>,
    sourcesContent: Array<string>,
    mappings: string,
    names: Array<string>
  }
}

module.exports = {
  compiler: boolean,
  minifier: boolean,
  process: function(contents: string, parameters: UCompilerJob): UCompilerResult | Promise<UCompilerResult>
}

License

This project is licensed under the terms of MIT License. See the LICENSE file for more info.

Current Tags

  • 3.2.0                                ...           latest (4 years ago)

51 Versions

  • 3.2.0 [deprecated]           ...           4 years ago
  • 3.1.9 [deprecated]           ...           4 years ago
  • 3.1.8 [deprecated]           ...           4 years ago
  • 3.1.7 [deprecated]           ...           4 years ago
  • 3.1.6 [deprecated]           ...           4 years ago
  • 3.1.5 [deprecated]           ...           4 years ago
  • 3.1.4 [deprecated]           ...           4 years ago
  • 3.1.3 [deprecated]           ...           4 years ago
  • 3.1.1 [deprecated]           ...           4 years ago
  • 3.0.1 [deprecated]           ...           4 years ago
  • 3.0.0 [deprecated]           ...           4 years ago
  • 2.1.4 [deprecated]           ...           4 years ago
  • 2.1.3 [deprecated]           ...           4 years ago
  • 2.1.2 [deprecated]           ...           4 years ago
  • 2.1.1 [deprecated]           ...           4 years ago
  • 2.1.0 [deprecated]           ...           4 years ago
  • 2.0.1 [deprecated]           ...           5 years ago
  • 2.0.0 [deprecated]           ...           5 years ago
  • 1.3.0 [deprecated]           ...           5 years ago
  • 1.2.4 [deprecated]           ...           5 years ago
  • 1.2.3 [deprecated]           ...           5 years ago
  • 1.2.2 [deprecated]           ...           5 years ago
  • 1.2.1 [deprecated]           ...           5 years ago
  • 1.2.0 [deprecated]           ...           5 years ago
  • 1.1.8 [deprecated]           ...           5 years ago
  • 1.1.7 [deprecated]           ...           5 years ago
  • 1.1.6 [deprecated]           ...           5 years ago
  • 1.1.5 [deprecated]           ...           5 years ago
  • 1.1.4 [deprecated]           ...           5 years ago
  • 1.1.3 [deprecated]           ...           5 years ago
  • 1.1.2 [deprecated]           ...           5 years ago
  • 1.1.1 [deprecated]           ...           5 years ago
  • 1.1.0 [deprecated]           ...           5 years ago
  • 1.0.5 [deprecated]           ...           5 years ago
  • 1.0.4 [deprecated]           ...           5 years ago
  • 1.0.3 [deprecated]           ...           5 years ago
  • 1.0.2 [deprecated]           ...           5 years ago
  • 1.0.1 [deprecated]           ...           5 years ago
  • 1.0.0 [deprecated]           ...           5 years ago
  • 0.0.13 [deprecated]           ...           5 years ago
  • 0.0.12 [deprecated]           ...           5 years ago
  • 0.0.11 [deprecated]           ...           5 years ago
  • 0.0.10 [deprecated]           ...           5 years ago
  • 0.0.9 [deprecated]           ...           5 years ago
  • 0.0.8 [deprecated]           ...           5 years ago
  • 0.0.7 [deprecated]           ...           5 years ago
  • 0.0.5 [deprecated]           ...           5 years ago
  • 0.0.4 [deprecated]           ...           5 years ago
  • 0.0.3 [deprecated]           ...           5 years ago
  • 0.0.2 [deprecated]           ...           5 years ago
  • 0.0.1 [deprecated]           ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 51
Last Day 0
Last Week 0
Last Month 153
Dependencies (9)
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |