Firstly,I’m disappointed that physicsjs is no longer maintained. As I am new to coffeescipt.I would like to setup coffeescipt with physicsjs.
I have written some code in a gulp file for automation:
Here it is:
const gulp = require("gulp")
const less = require("gulp-less")
const sourcemaps = require("gulp-sourcemaps")
const coffee = require("gulp-coffee")
const inject = require("gulp-inject")
const sources = {
js: 'public/js/*.js',
css: 'public/css/*.css'
}
gulp.task("inject", function (done) {
gulp.src('./public/*.html')
.pipe(inject(gulp.src([sources.css, sources.js], {
read: false
}), {
relative: true
})) // This will always inject vendor files before app files
.pipe(gulp.dest('./public'));
done()
})
gulp.task('less', function (done) {
gulp.src(['src/less/**/*.less', 'src/less/*.less'])
.pipe(sourcemaps.init())
.pipe(less({
base: true,
paths: ['src/less/include']
}))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('public/css'))
done()
})
//
gulp.task('coffee', function (done) {
gulp.src(["src/coffee/*.coffee",'src/coffee/**/*.coffee'])
.pipe(sourcemaps.init())
.pipe(coffee({
base: true
}))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('public/js'))
done()
})
gulp.task('watch', gulp.series(['less', 'coffee', 'inject'], function (done) {
gulp.watch(["src/coffee/*.coffee", "src/coffee/**/*.coffee"], gulp.series(['coffee']))
gulp.watch(["src/less/*.less", "src/less/**/*.less"], gulp.series(['less']))
// gulp.watch(["public/**/*.html", "public/*.html"], gulp.series(['inject']))
done()
}))
gulp.task('default', gulp.series(['watch']))
How can I integrate coffeescript with physicsjs?
I would like to make coffeescript work with physicsjs as I cannot find any coffeescript and physicsjs documentation online.