Giter VIP home page Giter VIP logo

grunt-brerror's Introduction

Grunt browser error

A Grunt plugin to display compile errors directly in your browser. The error tab is closed when the failing task(s) succeed.

Disclaimer

This module is still very experimental. Contributions are very welcome.

Installation

Just run

npm install --save-dev grunt-brerror

and you are done.

Screencast

Screencast

Usage

You need to run the task brerror:server before anything. This tasks blocks, so you must run it using grunt-concurrent or something similar.

After, just prepend brerror: to the task for which you want to display errros in your browser.

Here is a sample configuration.

module.exports = (grunt) ->
  grunt.initConfig
    watch:
      scripts:
        files: 'src/**/*.coffee'
        tasks: ['brerror:coffee:dev']

    coffee:
      dev:
        files: [
          expand: true
          src: ['src/**/*.coffee']
          dest: 'js'
          ext: '.js'
        ]

    concurrent:
      default:
        tasks: ['watch', 'brerror:server']
        options:
          logConcurrentOutput: true

    grunt.loadNpmTasks 'grunt-contrib-watch'
    grunt.loadNpmTasks 'grunt-contrib-coffee'
    grunt.loadNpmTasks 'grunt-concurrent'
    grunt.loadNpmTasks 'grunt-brerror'

    grunt.registerTask 'default', ['concurrent:default']

How does it work

This module uses websockets for IPC and to close the browser tabs.

The brerror:server task runs the websocket server. During the brerror task, a connection is made after the build, and the status of the build is sent with the output. The output is collected by hooking grunt.log methods.

The server then closes the tab with websokets, and displays the error page when necessary.

Known limitations

  • Does not seem to work with spawn: false for watch task
  • Probably buggy if compile tasks are run concurrently

grunt-brerror's People

Contributors

danhper avatar

Stargazers

Naito Takao avatar

Watchers

James Cloos avatar  avatar Kory Yahagi avatar Yuya Soneoka avatar  avatar

grunt-brerror's Issues

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.