Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit bbb61ac

Browse files
committed
Use dest for --output if specified for pscMake
1 parent 878f266 commit bbb61ac

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,13 @@ Toggles the `--runtime-type-checks` compiler flag. Generates simple runtime type
100100
## The "pscMake" task
101101

102102
### Overview
103-
This task runs the `psc-make` executable, which will compile modules to their own `.js` and `.externs` files in the `js/` and `externs/` folders respectively. This mode is useful when developing large libraries, since it avoids recompiling unchanged modules.
103+
This task runs the `psc-make` executable, which will compile modules to their own `.js` and `.externs` files. If no `dest` is specified the files will be generated in the `output/` folder. This mode is useful when developing large libraries, since it avoids recompiling unchanged modules.
104104

105105
In your project's Gruntfile, add a section named `pscMake` to the data object passed into `grunt.initConfig()`.
106106

107107
```js
108108
grunt.initConfig({
109109
pscMake: ["path/to/source/**/*.purs"]
110-
options: {
111-
// Task-specific options go here.
112-
},
113-
your_target: {
114-
// Target-specific file lists and/or options go here.
115-
},
116-
},
117110
});
118111
```
119112

@@ -126,6 +119,7 @@ grunt.initConfig({
126119
// Task-specific options go here.
127120
},
128121
src: ["path/to/source/**/*.purs"]
122+
dest: "build"
129123
},
130124
});
131125
```

tasks/purescript.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ module.exports = function (grunt) {
144144
// Get source file and common command line arguments
145145
var args = getDefaultArgs(this.filesSrc, this.options());
146146

147+
if (this.data.dest) {
148+
args.push("--output=" + this.data.dest);
149+
}
150+
147151
// Run the compiler
148152
return grunt.util.spawn({
149153
cmd: "psc-make",

0 commit comments

Comments
 (0)