Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

gulp-livescript

tomchentw242MIT3.0.1

Compile livescript to JavaScript for Gulp

livescript, gulp, gulpplugin

readme

gulp-livescript

Compile LiveScript to JavaScript for Gulp

Version Travis CI Quality Coverage Dependencies Gitter

Installation

npm i --save gulp-livescript

Information

Packagegulp-livescript
Description Compile LiveScript to JavaScript for Gulp
Node Version >= 0.10
Gulp Version >= 3.5.0

Example

See how we compile src/index.ls to lib/index.js in this project.

Notice: I used gulpfile to compile src to lib in the old days, now I use lsc compiler directly.

`gulpfile.ls`

Usage

var gulpLiveScript = require('gulp-livescript');

gulp.task('ls', function() {
  return gulp.src('./src/*.ls')
    .pipe(gulpLiveScript({bare: true})
    .on('error', gutil.log))
    .pipe(gulp.dest('./public/'));
});

Error Handling

gulp-livescript will emit an error for cases such as invalid LiveScript syntax.

If you need to exit gulp with non-0 exit code, attatch a lister and throw the error:

gulp.task 'build' ->
  return gulp.src 'test/fixtures/illegal.ls'
    .pipe gulp-livescript bare: true
    .on 'error' -> throw it
    .pipe gulp.dest '.'

Options

The options object supports the same options as the standard LiveScript compiler.

Source maps

gulp-livescript can be used in tandem with gulp-sourcemaps to generate source maps for the livescript to javascript transition. You will need to initialize gulp-sourcemaps prior to running the gulp-livescript compiler and write the source maps after.

var sourcemaps = require('gulp-sourcemaps');

gulp.src('./src/*.ls')
  .pipe(sourcemaps.init())
  .pipe(livescript())
  .pipe(sourcemaps.write())
  .pipe(gulp.dest('./dest/js'));

// will write the source maps inline in the compiled javascript files

By default, gulp-sourcemaps writes the source maps inline in the compiled javascript files. To write them to a separate file, specify a relative file path in the sourcemaps.write() function.

var sourcemaps = require('gulp-sourcemaps');

gulp.src('./src/*.ls')
  .pipe(sourcemaps.init())
  .pipe(livescript({ bare: true })).on('error', gutil.log)
  .pipe(sourcemaps.write('./maps'))
  .pipe(gulp.dest('./dest/js'));

// will write the source maps to ./dest/js/maps

Contributing

devDependency Status

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Credits

changelog

Change Log

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

3.0.1 (2016-05-31)

3.0.0 (2015-12-07)

Features

  • package.json: upgrade dependencies (7af8d07)

2.4.1 (2015-12-07)

Bug Fixes

  • index.ls: use relative path in sourceMap.sources (785374e), closes #25

2.4.0 (2015-06-08)

Features

  • index.ls: support sourcemap (544eb886)

2.3.1 (2015-05-21)

2.3.0 (2014-11-23)

Features

  • shows filename on compilation error (919c401a)

2.2.1 (2014-11-20)

2.2.0 (2014-11-09)

Features

  • index.ls: rewrite module in object-oriented way (60944855)
  • lib: compile LS to JS (c1e77427)

2.1.1 (2014-11-07)

Bug Fixes

2.1.0 (2014-11-06)

Features

  • index.js: add support for .json.ls extension (043d92da)

2.0.0 (2014-10-17)

Features

  • package.json:
    • move LiveScript to peerDependencies (8a7bd6fd)
    • changed dependencies from ~ to ^ (2fc18196)

1.3.0 (2014-10-17)

Bug Fixes

  • index.js: require syntax for LiveScript 1.3.0 (0dcbb6bf)

Features

  • package.json: upgrade LiveScript to 1.3.0 (3c2202d4)

1.2.1 (2014-10-17)

Bug Fixes

  • index.js: require syntax for LiveScript 1.2.0 (0f3d00f6)

1.2.0 (2014-10-13)

Bug Fixes

  • index.js: require syntax for LiveScript 1.3.0 (26ad4a7e)

1.1.1 (2014-10-02)

1.1.0 (2014-09-23)

Features

  • index: add support for outputing json (306da937)

1.0.3 (2014-06-18)

1.0.2 (2014-06-15)

Bug Fixes

  • package.json: downgrade through2 to 0.5.1 (537e8863)

1.0.1 (2014-06-13)

Features

  • package.json: update dependencies (b29ff385)

1.0.0 (2014-06-13)

0.3.0 (2014-05-25)

Features

  • index.js: replace map-stream with through2 (62ad1579)

0.2.1 (2014-03-07)

Bug Fixes

Features

0.2.0 (2014-02-17)

Features

0.1.2 (2014-02-15)

0.1.1 (2014-01-18)

0.0.12 (2014-01-12)

Bug Fixes

0.0.11 (2014-01-12)

0.0.10 (2014-01-12)

Bug Fixes

0.0.9 (2014-01-11)

Bug Fixes

0.0.8 (2014-01-11)

0.0.7 (2014-01-11)

Bug Fixes

0.0.6 (2014-01-08)

Fix test suite usage with npm test, and add example folder.

0.0.5 (2014-01-06)

Add gemnasium bagde to README and fix package.json repository link.

0.0.4 (2014-01-05)

Add gulp-conventional-changelog and gulp-release into release task.

0.0.3 (2014-01-05)

Bug Fixes

Features