Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fbuild

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fbuild

build tool

  • 2.0.18
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

FBuild - 自动化构建工具

  • 支持按目录打包
  • 支持less自动编译
  • html模板编译成 AMD 规则的包
  • 加入雪碧图生成

快速开始

安装并初始化目录结构
sudo npm install fbuild -g
cd [目录]
fbuild init 
初始化一个包 'hello'
fbuild init.pack hello
初始化 1.0.2 的包 'hello'
fbuild init.pack hello 1.0.2
生成 'hello' 包文档
fbuild build.doc hello 
# 生成1.0.2文档
fbuild build.doc hello 1.0.2 
开启自动构建监视
fbuild
单独构建雪碧图
cd [png目录]
fbuild sp out=../img less=../less
fbuild 目录结构是这样的
|- static
  |- js
    |- fbuild.json #fbuild 的配置文件
    |- config.js #根据构建的内容,自动生成配置
    |- config.dev.js #根据构建的内容,自动生成配置, dev 环境
    |- pack
      |- hello
        |- dist
          |- hello.all.js #自动合并
          |- hello.min.xxxxxx.js #压缩并根据内容hash文件名
        |- src
          |- index.js
          |- word.js

目录结构约定

模板约定

define('tpl/*') 为保留前缀,所有自动生成的模板, 使用该规则,生成 AMD 规则的model

|- [static]
  |- tpl #模板根目录
    |- pack #模板所在的包,对应 defind('tpl/pack')
      |- index.html
      |- test.html

这时,调用 tpl/pack/test.html 的内容,只需执行

require(['tpl/pack'], function(pack){
    console.log(pack['test.html']);
});
less 约定
|- [static]
  |- style
    |- less #less源文件存放目录
    |- css #编译后的文件存放目录
配置文件, 默认调用的包版本

!!默认!! 最后编辑那个版本,就用那个版本

如需要指定版本,请编辑 fbuild.json

{
    "//": "指定包的版本,注:如果没有指定,修改那个版本,就使用那个版本",
    "packVersion": {
        "packName": "1.0.4"
    }

}
升级fbuild
sudo npm update -g fbuild

Keywords

FAQs

Package last updated on 07 Oct 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc