This repository has been archived on 2023-12-22. You can view files and clone it, but cannot push or open issues or pull requests.
old-monorepo/_Dashboard/tasks/scripts.js

26 lines
638 B
JavaScript
Raw Normal View History

2020-07-30 20:59:37 +02:00
const { src, dest } = require('gulp');
const babel = require('gulp-babel');
const sourcemaps = require('gulp-sourcemaps');
const inject = require('gulp-inject-string');
function build() {
return src('app/**/*.js')
.pipe(babel())
.pipe(inject.replace('process.env.NODE_ENV', '"production"'))
.pipe(dest('build'));
}
function developBuild() {
return src('app/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write())
.pipe(dest('build'));
}
build.displayName = 'build-scripts';
developBuild.displayName = 'dev-build-scripts';
exports.build = build;
exports.developBuild = developBuild;