Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import gulp from 'gulp';
import plumber from 'gulp-plumber';
import babel from 'gulp-babel';
import notify from 'gulp-notify';
import rename from 'gulp-rename';
import cache from 'gulp-cache';
import project from '../aurelia.json';
import fs from 'fs';
import through from 'through2';
import {CLIOptions, build, Configuration} from 'aurelia-cli';
let env = CLIOptions.getEnvironment();
const buildOptions = new Configuration(project.build.options);
const useCache = buildOptions.isApplicable('cache');
function configureEnvironment() {
return gulp.src(`aurelia_project/environments/${env}.js`, {since: gulp.lastRun(configureEnvironment)})
.pipe(rename('environment.js'))
.pipe(through.obj(function (file, _, cb) {
// https://github.com/aurelia/cli/issues/1031
fs.unlink(`${project.paths.root}/${file.relative}`, function () { cb(null, file); });
}))
.pipe(gulp.dest(project.paths.root));
}
function buildJavaScript() {
let transpile = babel(project.transpiler.options);
if (useCache) {
// the cache directory is "gulp-cache/projName-env" inside folder require('os').tmpdir()
import gulp from 'gulp';
import plumber from 'gulp-plumber';
import babel from 'gulp-babel';
import notify from 'gulp-notify';
import rename from 'gulp-rename';
import cache from 'gulp-cache';
import project from '../aurelia.json';
import {CLIOptions, build, Configuration} from 'aurelia-cli';
let env = CLIOptions.getEnvironment();
const buildOptions = new Configuration(project.build.options);
const useCache = buildOptions.isApplicable('cache');
function configureEnvironment() {
return gulp.src(`aurelia_project/environments/${env}.js`, {since: gulp.lastRun(configureEnvironment)})
.pipe(rename('environment.js'))
.pipe(gulp.dest(project.paths.root));
}
function buildJavaScript() {
let transpile = babel(project.transpiler.options);
if (useCache) {
// the cache directory is "gulp-cache/projName-env" inside folder require('os').tmpdir()
// use command 'au clear-cache' to purge all caches
transpile = cache(transpile, {name: project.name + '-' + env});
}
import gulp from 'gulp';
import changedInPlace from 'gulp-changed-in-place';
import plumber from 'gulp-plumber';
import babel from 'gulp-babel';
import sourcemaps from 'gulp-sourcemaps';
import notify from 'gulp-notify';
import rename from 'gulp-rename';
import cache from 'gulp-cache';
import project from '../aurelia.json';
import {CLIOptions, build, Configuration} from 'aurelia-cli';
let env = CLIOptions.getEnvironment();
const buildOptions = new Configuration(project.build.options);
const useCache = buildOptions.isApplicable('cache');
function configureEnvironment() {
return gulp.src(`aurelia_project/environments/${env}.js`)
.pipe(changedInPlace({firstPass: true}))
.pipe(rename('environment.js'))
.pipe(gulp.dest(project.paths.root));
}
function buildJavaScript() {
let transpile = babel(project.transpiler.options);
if (useCache) {
// the cache directory is "gulp-cache/projName-env" inside folder require('os').tmpdir()
// use command 'au clear-cache' to purge all caches
transpile = cache(transpile, {name: project.name + '-' + env});
}
import gulp from 'gulp';
import plumber from 'gulp-plumber';
import babel from 'gulp-babel';
import notify from 'gulp-notify';
import rename from 'gulp-rename';
import cache from 'gulp-cache';
import project from '../aurelia.json';
import {CLIOptions, build, Configuration} from 'aurelia-cli';
let env = CLIOptions.getEnvironment();
const buildOptions = new Configuration(project.build.options);
const useCache = buildOptions.isApplicable('cache');
function configureEnvironment() {
return gulp.src(`aurelia_project/environments/${env}.js`, {since: gulp.lastRun(configureEnvironment)})
.pipe(rename('environment.js'))
.pipe(gulp.dest(project.paths.root));
}
function buildJavaScript() {
let transpile = babel(project.transpiler.options);
if (useCache) {
// the cache directory is "gulp-cache/projName-env" inside folder require('os').tmpdir()
// use command 'au clear-cache' to purge all caches
transpile = cache(transpile, {name: project.name + '-' + env});
}
import gulp from 'gulp';
import plumber from 'gulp-plumber';
import babel from 'gulp-babel';
import notify from 'gulp-notify';
import rename from 'gulp-rename';
import cache from 'gulp-cache';
import project from '../aurelia.json';
import fs from 'fs';
import through from 'through2';
import { CLIOptions, build, Configuration } from 'aurelia-cli';
let env = CLIOptions.getEnvironment();
const buildOptions = new Configuration(project.build.options);
const useCache = buildOptions.isApplicable('cache');
function configureEnvironment() {
return gulp.src(`aurelia_project/environments/${env}.js`, {
since: gulp.lastRun(configureEnvironment)
})
.pipe(rename('environment.js'))
.pipe(through.obj(function (file, _, cb) {
// https://github.com/aurelia/cli/issues/1031
fs.unlink(`${project.paths.root}/${file.relative}`, function () {
cb(null, file);
});
}))
.pipe(gulp.dest(project.paths.root));
}
import webpackConfig from '../../webpack.config';
import webpack from 'webpack';
import project from '../aurelia.json';
import gulp from 'gulp';
import del from 'del';
import {CLIOptions, Configuration} from 'aurelia-cli';
import configureEnvironment from './environment';
const analyze = CLIOptions.hasFlag('analyze');
const buildOptions = new Configuration(project.build.options);
const production = CLIOptions.getEnvironment() === 'prod';
const server = buildOptions.isApplicable('server');
const extractCss = buildOptions.isApplicable('extractCss');
const coverage = buildOptions.isApplicable('coverage');
const config = webpackConfig({
production, server, extractCss, coverage, analyze
});
const compiler = webpack(config);
function buildWebpack(done) {
if (CLIOptions.hasFlag('watch')) {
compiler.watch({}, onBuild);
} else {
compiler.run(onBuild);
compiler.hooks.done.tap('done', () => done());
import webpackConfig from '../../webpack.config';
import webpack from 'webpack';
import project from '../aurelia.json';
import {CLIOptions, Configuration} from 'aurelia-cli';
import gulp from 'gulp';
import configureEnvironment from './environment';
import del from 'del';
const analyze = CLIOptions.hasFlag('analyze');
const buildOptions = new Configuration(project.build.options);
const production = CLIOptions.getEnvironment() === 'prod';
const server = buildOptions.isApplicable('server');
const extractCss = buildOptions.isApplicable('extractCss');
const coverage = buildOptions.isApplicable('coverage');
const config = webpackConfig({
production, server, extractCss, coverage, analyze
});
const compiler = webpack(config);
function buildWebpack(done) {
if (CLIOptions.hasFlag('watch')) {
compiler.watch({}, onBuild);
} else {
compiler.run(onBuild);
compiler.hooks.done.tap('done', () => done());
import * as webpackConfig from '../../webpack.config';
import * as webpack from 'webpack';
import * as project from '../aurelia.json';
import {CLIOptions, Configuration} from 'aurelia-cli';
const buildOptions = new Configuration(project.build.options);
const isProd = CLIOptions.getEnvironment() === 'prod';
const server = buildOptions.isApplicable('server');
const extractCss = buildOptions.isApplicable('extractCss');
const coverage = buildOptions.isApplicable('coverage');
const config = webpackConfig({
isProd, server, extractCss, coverage
});
const compiler = webpack(config);
function build(done) {
compiler.run(onBuild);
compiler.plugin('done', () => done());
}
function onBuild(err, stats) {