Skip to content

fbi-templates/fbi-project-fullpack

Repository files navigation

fbi-project-fullpack

Progressive frontend project template.

This is a fbi project template. If you haven't installed fbi yet, use the following command to install.

$ npm i -g fbi or yarn global add fbi

中文 README

Requirements

  • fbi v3.0+
  • node v7.6+

Features

  • Support pure HTML and Handlebars template.
  • Support pure CSS and Sass-like PostCSS
  • Support ES5, ES2015, ES2016, ES2017. Adds specific imports for polyfills automatically when they are used in each file. (polyfills will increase the file size, please use as appropriate.) see more
  • Support WebAssembly, Web Worker, Typescript
  • Unlimited environment data.
  • Http proxy.
  • Paths mapping.
  • Javascript linting and CSS linting.
  • Minify.
  • Highly configurable.

Usage

Create a project

$ cd path/to/workspace
$ fbi init https://github.com/fbi-templates/fbi-project-fullpack.git my-project

or

$ fbi add https://github.com/fbi-templates/fbi-project-fullpack.git
$ cd path/to/empty-folder
$ fbi init fullpack

Show available tasks

$ fbi ls

Run a task

$ fbi <task> [params]

Tasks

serve

  • Description: Start development server.
  • Params:
    • port {Number} Server starting port. If occupied, switch automatically.
    • p, prod {Boolean} Serve production dist folder.
    • t, test {Boolean} Serve test dist folder.
  • Alias: s
  • Examples:
    • fbi s -port=9999
    • fbi s -t
    • fbi s -p

build

  • Description: Build the project for the specified environment.
  • Params:
    • p, prod {Boolean} (default) Production environment.
    • t, test {Boolean} Test environment.
    • d, dev {Boolean} Development environment.
  • Alias: b
  • Examples:
    • fbi b -t
    • fbi b -t=true
    • fbi b -test=true
    • fbi b --p
    • fbi b -d

clean

  • Description: Clean up destinations.
  • Params: none
  • Alias: c
  • Examples:
    • fbi c
    • fbi clean

Advanced

How to change the build configuration?

  1. Initialize the options file to the project directory.
$ cd path/to/project
$ fbi init -o # or `--options`
  1. The options file will be located at fbi/options.js, includes instructions.

How to change the build logic?

  1. Initialize options file and tasks to the project directory.
$ cd path/to/project
$ fbi init -t # or `--tasks`
  1. Files will be located at fbi folder. Do what you want to do.

Where is the build dependencies?

Build dependencies are by default in fbi's store. You can use the following command to download to the project.

$ fbi init -a  # or `--all`

Note: If local tasks or options exist, the original files will be backed up in fbi-bak folder.

Options

fbi/options.js

Property Description Links
data Environment data source
proxy Http proxy koa-proxies node-http-proxy
mapping Paths mapping source
server Development Server config source
webpack Webpack simple config source
lint Code linting options eslint-config-airbnb-base stylelint-config-standard
minify Minify options html-minifier uglifyjs-webpack-plugin cssnano
copy Copy options copy-webpack-plugin
templates Template engine name source
scripts babel-loader options babel-loader
styles PostCSS options postcss-loader

More

License

MIT

Changelog

Latest

  • v3.1.2 (2018.06.26)

    • Add Page Index when serving static
    • Add tslint
    • Remove webpack-stylish plugin
    • Update html-inline-webpack-plugin
    • Replace eslint-config-airbnb with eslint-config-standard
  • v3.1.1 (2018.06.14)

    • Add 'typescript' option for enable or turn off typescript support
    • Remove webpack.NamedModulesPlugin on production mode
  • v3 (2018.06.08)

    • Update dependencies.
    • Using webpack 4 now.
    • Added support for 'web worker', WebAssembly, Typescript.
  • v2.1.5 (2018.01.26)

    • BugFixes: ES6 compilation failed(babel-loader options include)
  • v2.1.0 (2017.12.10)

    • Refactor: building logic, project structure.
  • v2.0.3 (2017.12.09)

    • Compatible webpack.commons with old version
  • v2.0.2 (2017.12.09)

    • Update package info. Add .editorconfig previously.
  • v2.0.0 (2017.12.09)

    • initialization