Giter Club home page Giter Club logo

stc's Introduction

stc

高性能前端工作流系统

改进编译性能的几种方式

  • 充分利用多核 CPU
  • 基于 AST/Token
  • 分析依赖树
  • 无感知的缓存策略

工作流处理步骤

处理流程分为下面 4 个步骤,其中 lint,transpile 和 dependence 里的插件是并行处理,workflow 里的插件是串行处理。

  • lint - 代码规范检查,如:用 eslint 检查 JS 代码
  • transpile - 转译,将非标准的 HTML/JS/CSS 转换为标准的文件,如: TypeScript,Less,Sass
  • dependence - 依赖分析,workflow 里只处理被依赖的文件,提高编译性能
  • workflow - 内容替换等处理,如:压缩,上 CDN

配置文件示例

// stc.config.js

var stc = require('stc');
var uglify = require('stc-uglify');
var eslint = require('stc-eslint');

stc.config({
  include: ['template/', 'static/']
})

stc.lint({
    eslint: {plugin: eslint, include: /\.js$/, options: {}}
});

stc.workflow({
    uglify: {plugin: uglify, include: /\.js$/, options: {}}
});

stc.start(); // 启动工作流程

已经开发完成的插件

lint

transpile

dependence

workflow

需要开发的插件

  • 国际化
  • CSS Sprite
  • seajs 代码合并
  • 模板 XSS 自动修复功能
  • CDN 功能上传到阿里云、七牛、又拍云的适配器
  • Vue.js 代码转译
  • Weex 代码转译
  • 类似 webpack 将项目打包在一起的插件
  • fontello
  • jade 预编译
  • nunjucks 预编译

如何开发

如何开发?

stc's People

Contributors

alphatr avatar alvarto avatar caisijie avatar huangxiaolu avatar lizheming avatar lushijie avatar qgy18 avatar welefen avatar

Watchers

 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.