rm @build/tsPlugins
parent
5f15b231dc
commit
2a6f63c1d7
|
@ -54,10 +54,8 @@
|
|||
"ui/tournamentCalendar",
|
||||
"ui/tree",
|
||||
"ui/msg",
|
||||
"ui/@build/cssProject",
|
||||
"ui/@build/jsProject",
|
||||
"ui/@build/tsProject",
|
||||
"ui/@build/tsPlugins",
|
||||
"ui/@build/rollupProject",
|
||||
"ui/@types/lichess"
|
||||
]
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
const gulp = require('gulp');
|
||||
const source = require('vinyl-source-stream');
|
||||
const buffer = require('vinyl-buffer');
|
||||
const colors = require('ansi-colors');
|
||||
const logger = require('fancy-log');
|
||||
const watchify = require('watchify');
|
||||
const browserify = require('browserify');
|
||||
const terser = require('gulp-terser');
|
||||
const size = require('gulp-size');
|
||||
const tsify = require('tsify');
|
||||
|
||||
module.exports = (plugins) => {
|
||||
|
||||
const destination = () => gulp.dest(`../../public/compiled/`);
|
||||
|
||||
const mainProd = gulp.task('prod');
|
||||
|
||||
const pluginsProd = plugins.map(opts => {
|
||||
return () => browserify(opts)
|
||||
.plugin(tsify)
|
||||
.bundle()
|
||||
.pipe(source(opts.target))
|
||||
.pipe(buffer())
|
||||
.pipe(terser({safari10: true}))
|
||||
.pipe(size())
|
||||
.pipe(destination());
|
||||
});
|
||||
|
||||
gulp.task('prod', gulp.series(pluginsProd.concat(mainProd)));
|
||||
|
||||
const pluginWatch = (opts) => () => {
|
||||
|
||||
const bundle = () => bundler
|
||||
.bundle()
|
||||
.on('error', error => logger.error(colors.red(error.message)))
|
||||
.pipe(source(opts.target))
|
||||
.pipe(destination());
|
||||
|
||||
const bundler = watchify(
|
||||
browserify(Object.assign({}, watchify.args, {...opts, debug: true}))
|
||||
.plugin(tsify)
|
||||
).on('update', bundle).on('log', logger.info);
|
||||
|
||||
return bundle();
|
||||
};
|
||||
|
||||
plugins.map(plugin => {
|
||||
gulp.task(plugin.standalone, pluginWatch(plugin));
|
||||
});
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"name": "@build/tsPlugins",
|
||||
"version": "2.0.0",
|
||||
"private": true,
|
||||
"author": "Thibault Duplessis",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"gulp": "^4",
|
||||
"vinyl-source-stream": "^2",
|
||||
"vinyl-buffer": "^1",
|
||||
"ansi-colors": "^1",
|
||||
"fancy-log": "^1",
|
||||
"watchify": "^3",
|
||||
"browserify": "^16",
|
||||
"gulp-terser": "^1",
|
||||
"gulp-size": "^3",
|
||||
"tsify": "^4",
|
||||
"typescript": "^3"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue