Coder Social home page Coder Social logo

balm's Introduction

BalmJS NPM version Build Status Dependency Status

Demo

Installation

$ npm install --save-dev balm gulp

Usage

// gulpfile.js
var balm = require('balm');

balm.config = {
  // your project config
};

balm.go();
# for development
$ gulp

# for production
$ gulp --production

Config

// just for npm2
$ npm install --save-dev webpack-hot-middleware
// for ES6
$ npm install --save-dev babel-preset-es2015

// .babelrc
{
  "presets": ["es2015"]
}
// for IE8(ES3)
$ npm install --save-dev babel-preset-es2015-loose
$ npm install --save-dev babel-plugin-transform-es3-member-expression-literals
$ npm install --save-dev babel-plugin-transform-es3-property-literals

// .babelrc
{
  "presets": ["es2015-loose"],
  "plugins": [
    "transform-es3-member-expression-literals",
    "transform-es3-property-literals"
  ]
}

Project Type

{
  ...
  static: false, // set `true` for the static HTML project
  ...
}

Server

{
  ...
  proxy: undefined, // your.project.local
  server: {
    host: null,
    port: 3000
  },
  ...
}

Root

{
  ...
  roots: {
    source: 'app',  // input folder
    target: 'dist' // output folder
  },
  ...
}

Path

{
  ...
  paths: {
    source: {
      base: '',
      html: '',
      css: 'styles', // css dir
      js: 'scripts', // javascript dir
      img: 'images', // image dir
      font: 'fonts'  // font dir
    },
    target: {
      base: '',
      html: '',
      css: 'css',
      js: 'js',
      img: 'img',
      font: 'fonts'
      // cache: 'assets' // custom cache dir
    }
  },
  ...
}

Style

{
  ...
  styles: {
    autoprefixer: ['last 2 versions'],
    ext: 'scss'
  },
  ...
}

Support extension: css, less, sass, scss

Script

{
  ...
  scripts: {
    entry: {
      'main': './app/scripts/main.js'
    },
    publicPath: '/',
    filename: '[name].js',
    loaders: [], // e.g. { test: /\.vue$/, loader: 'vue' }
    extensions: [], // e.g. '.vue'
    alias: {}
  },
  ...
}

BalmJS default loaders: html, style, css, postcss, babel, url, file, json.

BalmJS default extensions: .js, .jsx, .json.

Sprite

{
  ...
  sprites: {
    basePath: '..',     // relative to css file
    cssPath: 'sprites', // css folder
    imgList: []         // image folder, e.g. 'icon'
  },
  ...
}

Cache

{
  ...
  cache: false,
  ...
}

Zip

{
  ...
  zip: 'archive', // zip filename
  ...
}

License

© Elf-mousE

thx node&gulp

balm's People

Contributors

elf-mouse avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.