gulp-playcanvas
v2.0.2
Published
upload files to playcanvas editor
Downloads
11
Maintainers
Readme
gulp-playcanvas
This Plugin can upload to PlayCanvas.
Supported files : [.js
,.html
,.css
,.txt
,.json
]
Installation
npm install --save gulp-playcanvas
Features
Hot realod
- Installation.
npm init
npm install --save gulp gulp-playcanvas gulp-pug gulp-sass
- add playcanvas.json
//playcanavas.json
{
"accessToken": "",
"scenes": [],
"projectId": "",
"branchId": "",
"projectName": "",
"remotePath": ""
}
- add gulpfile.js
//gulpfile.js
const gulp = require("gulp");
const playcanvas = require("gulp-playcanvas");
const pcOptions = require("./config");
const pug = require("gulp-pug");
const sass = require("gulp-sass");
gulp.task("pug", () => {
return gulp
.src(["src/**/*.pug", "!src/**/_*.pug"])
.pipe(pug())
.pipe(gulp.dest("dist/"))
.pipe(playcanvas(pcOptions));
});
gulp.task("js", () => {
return gulp
.src(["src/**/*.js", "!src/**/_*.js"])
.pipe(gulp.dest("dist/"))
.pipe(playcanvas(pcOptions));
});
gulp.task("sass", () => {
return gulp
.src("src/**/*.+(scss|sass)")
.pipe(sass())
.pipe(gulp.dest("dist/"))
.pipe(playcanvas(pcOptions));
});
gulp.task("watch", function() {
gulp.watch(["src/**/*.pug", "!src/**/_*.pug"], gulp.task("pug"));
gulp.watch(["src/**/*.js", "!src/**/_*.js"], gulp.task("js"));
gulp.watch("src/**/*.+(scss|sass)", gulp.task("sass"));
});
gulp.task("default", gulp.parallel("watch"));
API
playcanvas(options)
options.accessToken
Required
Type: string
options.scenes
Required
Type: array<number>
options.projectId
Required
Type: number
options.branchId
Required
Type: string
options.projectName
Required
Type: string
options.remotePath
Required
Type: string
License
MIT © yushimatenjin