项目作者: njb-said

项目描述 :
A template node.js project with assets compiler & testing
高级语言: JavaScript
项目地址: git://github.com/njb-said/asset-build-template.git
创建时间: 2016-12-10T16:43:05Z
项目社区:https://github.com/njb-said/asset-build-template

开源协议:GNU General Public License v3.0

下载


asset-build-template Build Status

A template node.js project with assets compiler & tests.

Requirements

Usage

This project can be used with a CI such as Travis, CircleCI or CodeShip, using the npm test command.

It will minify all CSS and JavaScript files (you can also include libraries such as jQuery separately to your application)

To run tests on both JavaScript and CSS assets run:

  1. $ npm test
  2. > asset-build-template@1.0.0 test /home/ubuntu/asset-build-template
  3. > node assets --both-test
  4. Starting assets build for CSS, JS libraries and JS app...
  5. NOTICE: Build is error sensitive!
  6. > Built library JavaScripts in 20.900ms
  7. > Built CSS in 187.663ms
  8. > Built JavaScripts in 470.311ms
  9. > Assets build status: OK

To run tests on just JavaScript assets (both application and libraries) run: npm run test-js

To run tests on just CSS assets run: npm run test-css

Contributing

If you would like to contribute to this project, please do! Just keep a few things in mind:

  • ESLint is used to make sure code is up to standard
  • Pull requests must pass ESLint tests at Travis CI
  • Please use Spaces instead of tabs at a width of 4 for indenting

Notes

Using the npm scripts, the build will be error sensitive and fail if the minify library fails.

You can override this by requireing the assets.js file and calling the latestBuild function.

I will probably add an example of this in the future and document the function better.