|
1 | | -# gulp-purescript |
| 1 | +# [gulp](https://github.com/wearefractal/gulp)-purescript |
| 2 | + |
| 3 | +> Runs the [PureScript](http://www.purescript.org) compiler to produce JavaScript files |
| 4 | +
|
| 5 | +## Install |
| 6 | + |
| 7 | +Install with [npm](https://npmjs.org/package/gulp-purescript) |
| 8 | + |
| 9 | +``` |
| 10 | +npm install gulp-purescript --save-dev |
| 11 | +``` |
| 12 | + |
| 13 | +## Example |
| 14 | + |
| 15 | +```js |
| 16 | +var gulp = require('gulp') |
| 17 | + , purescript = require('gulp-purescript') |
| 18 | +; |
| 19 | +gulp.task('purescript', function(){ |
| 20 | + return ( |
| 21 | + gulp.src('src/**/*.purs.hs'). |
| 22 | + pipe(purescript.psc({noPrelude: true})). |
| 23 | + pipe(gulp.dest('dist/')) |
| 24 | + ); |
| 25 | +}); |
| 26 | +``` |
| 27 | + |
| 28 | +## API |
| 29 | + |
| 30 | +Refer to the PureScript [usage](http://docs.purescript.org/en/latest/intro.html#usage) section for additional details on the behaviour of each option below. |
| 31 | + |
| 32 | +### purescript.psc(options) |
| 33 | + |
| 34 | +Invokes the `psc` command. |
| 35 | + |
| 36 | +#### options |
| 37 | + |
| 38 | + - noPrelude: Boolean value that toggles `--no-prelude` |
| 39 | + - noOpts: Boolean value that toggles `--no-opts` |
| 40 | + - noMagicDo: Boolean value that toggles `--no-magic-do` |
| 41 | + - noTco: Boolean value that toggles `--no-tco` |
| 42 | + - runtimeTypeChecks: Boolean value that toggles `--runtime-type-checks` |
| 43 | + - verboseErrors: Boolean value that toggles `--verbose-errors` |
| 44 | + - main: Boolean or string value that sets `--main` or `--main=<string>` |
| 45 | + - browserNamespace: String value that sets `--browser-namespace=<string>` |
| 46 | + - externs: String value that sets `--externs=<string>` |
| 47 | + - modules: String or array value that sets one or more `--module=<string>` |
| 48 | + - codegen: String or array value that sets one or more `--codegen=<string>` |
| 49 | + |
| 50 | +### purescript.pscMake(options) |
| 51 | + |
| 52 | +Invokes the `psc-make` command. |
| 53 | + |
| 54 | +#### options |
| 55 | + |
| 56 | + - noPrelude: Boolean value that toggles `--no-prelude` |
| 57 | + - noOpts: Boolean value that toggles `--no-opts` |
| 58 | + - noMagicDo: Boolean value that toggles `--no-magic-do` |
| 59 | + - noTco: Boolean value that toggles `--no-tco` |
| 60 | + - runtimeTypeChecks: Boolean value that toggles `--runtime-type-checks` |
| 61 | + - verboseErrors: Boolean value that toggles `--verbose-errors` |
| 62 | + - browserNamespace: String value that sets `--browser-namespace=<string>` |
0 commit comments