GithubHelp home page GithubHelp logo

lpreterite / vfis Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 2.0 603 KB

The make fis3 to support vue, es6 and make it more easy !

License: MIT License

JavaScript 87.63% HTML 3.28% CSS 2.77% Vue 6.32%
fis vue sass fis3

vfis's Introduction

vfis-cli

Build Status

这个项目是把基于fis3构建的比较常用的功能集成一起的构建工具。包含功能以下功能:

  • 支持vue
  • 支持sass
  • autoprefixer兼容css
  • babel兼容es6
  • js依赖及引入
  • 按需合并文件
  • 图片合并
  • 图片压缩

安装及使用

安装

npm i -g vfis-cli

由于依赖的各种库比较大,请耐心等待。

使用

生成

vfis release -d ./output

生成并监控

vfis release -wL ./output

预览

vfis server start --root ./output

更多使用移步到 fis3 起步构建

设置

配合简易的设置可简化更多工作,下面是简单的使用例子,如想了解更多可看详细文档

快速上手

第一步,安装

// 安装vfis构建优化模块
$ npm i -D vfis

第二步,开始使用

//设置
# fis-conf.js
const vfis = require('vfis');

vfis({
    input: 'src/(*.html)',
    output: {
        default:{
            basePath: 'assets'
        }
    },
    pack: {
        vendor: {
            'vender.js': ['node_modules/**'],
            'main.js': ['src/**']
        }
    }
});

// 生成并监控文件变化自动刷新页面
$ fis3 release -d ./output -wL

// 预览
$ fis3 server start --root ./output

第三步,理解输出设置

fis.set('vfis.config', {
    input: '**/(*.html)',       //访问的文件入口
    output: {                   //输出文件目录及相关的设置
        default: {
            basePath: 'assets', //静态资源目录
            pagePath: '',       //页面生成目录
            url: '',            //静态资源访问的虚拟目录(指虚拟目录路径)
            domain: '',         //静态资源访问的域(指网站访问域,如:http://uxfeel.com)
        }
    }
})

运行环境

node 4.4.x
npm 3.10.x
python 2.7.x

win系统还需 Microsoft Visual Studio 2010以上
linux系统需要 c++运行环境

环境安装细节

win下需要管理者权限

# 更新npm
sudo npm update -g npm

# 安装fis3
sudo npm install -g fis3

安装依赖

命令行进入项目目录根

npm i

安装其他问题

假如运行出错,或很久不动,可能是node-sass安装问题,使用ctrl+c停止命令,然后重装。

npm rebuild node-sass

vfis's People

Contributors

lpreterite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

umphp fekid

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.