gulp-racket
v2.0.1
Published
RacketScript gulp plugin
Maintainers
Readme
gulp-racket - RacketScript - Gulp
Dependencies:
Detailed Installation Guide for gulp-racket and RacketScript
1. Install gulp-racket via npm
npm install --save-dev gulp-racket2. Download or clone RacketScript
Official repo: https://github.com/racketscript/racketscript
git clone https://github.com/racketscript/racketscript.git
cd racketscript
# (Optional: checkout to a specific branch or version)3. Install RacketScript dependencies (requires Racket to be installed)
raco pkg install --auto racketscriptNote:
If you use snap/flatpak or another way to install Racket, make sure theracocommand works and the package is installed for the correct Racket version.
4. Add the racks binary folder to your PATH
The racks executable is located in racketscript/racketscript-compiler/bin.
Add this folder to your PATH for your session (replace /path/to/racketscript with your actual path):
export PATH="$HOME/path-to-your-project/racketscript/racketscript-compiler/bin:$PATH"You can add this line to your
~/.bashrc,~/.zshrc, or~/.config/fish/config.fishso it is always available.
5. Verify the installation
Run:
racks --helpYou should see the RacketScript Compiler command help.
6. Use gulp-racket in your gulpfile.js
Example:
const gulp = require('gulp');
const racket = require('gulp-racket');
gulp.task('default', () =>
gulp.src('src/index.rkt')
.pipe(racket())
.pipe(gulp.dest('dist'))
);Common problems
rackscommand not found:
Make sure your PATH includesracketscript/racketscript-compiler/bin.- Complex numbers error:
Complex numbers are not supported by JavaScript; rewrite your code to avoid them. - JS doesn't work in the browser:
The generated JS uses ES6 modules and runtime files. Use<script type="module">and run through a local server.
Links
Usage:
import racketTransform from 'gulp-racket';
const racket = () => {
return gulp
.src('./src/*.rkt')
.pipe(racketTransform(`./example/dist`))
.pipe(gulp.dest(`./example/dist`));
};