README
elixir-typescript
(forked from laravel-elixir-typescript by okaufmann)
Prerequirement
You have to install Laravel's Elixir(Version 3.0 or higher) and its dependencies first.
Upgrade
The signature was changed to the following:
mix.typescript(src, output, options, flags);
Installation
Install with Node.js
npm install elixir-typescript --save
Usage
A simple gulp-typescript wrapper ingredient for Laravel Elixir.
Add it to your Elixir-enhanced Gulpfile, like so:
var elixir = require('laravel-elixir');
// import the dependency
var elixirTypscript = require('elixir-typescript');
elixir(function(mix) {
mix.typescript('app.ts');
});
This will compile the app.ts
file in resources/assets/typescript/
and concat the compiled content into public/js/app.js
.
If you'd like to output to a different directory than the default public/js
, then you may override this by provide a path for output
as well.
mix.typescript('app.js', 'public/js/foo/bar.js');
Further you could insert multiple files like
elixir(function(mix) {
mix.typescript(['module1.ts', 'module2.ts']);
});
If you wish to ignore Compilation errors
elixir(function(mix) {
mix.typescript('app.js', 'public/js/foo/bar.js', null, { 'ignoreErrors': true });
});
tsconfig.json
The project file is also supported. Just put your file into the typescript asset folder and the pluging will automatically use it.
Parameters
Bellow is the list of the available parameters:
- src: Filename for output
- output(optional): Where to place the output file. Default:
public/js/
- options (optional): Options to forward to the
gulp-typescript
used for compiling. All options under https://github.com/ivogabe/gulp-typescript#options - flags (optional): Flags that change the default behavior of the plugin.
Flags
List of available flags:
ignoreErrors (default: false) -> all errors will be ignored and the typescript will continue being compiled.