提交 8b16b319 编写于 作者: J Jason Park

gulp prod

上级 eaae81e9
'use strict';
import path from 'path';
import gulp from 'gulp';
import uglify from 'gulp-uglify';
import cleanCSS from 'gulp-clean-css';
import autoprefixer from 'gulp-autoprefixer';
import concat from 'gulp-concat';
import header from 'gulp-header';
import babel from 'gulp-babel';
import gutil from 'gulp-util';
import sourcemaps from 'gulp-sourcemaps';
import connect from 'gulp-connect';
import browserify from 'browserify';
import babelify from 'babelify';
import source from 'vinyl-source-stream';
import buffer from 'vinyl-buffer';
import pkg from './package.json';
import path from "path";
import gulp from "gulp";
import uglify from "gulp-uglify";
import cleanCSS from "gulp-clean-css";
import autoprefixer from "gulp-autoprefixer";
import concat from "gulp-concat";
import header from "gulp-header";
import gutil from "gulp-util";
import sourcemaps from "gulp-sourcemaps";
import connect from "gulp-connect";
import browserify from "browserify";
import babelify from "babelify";
import source from "vinyl-source-stream";
import buffer from "vinyl-buffer";
import pkg from "./package.json";
const appName = 'algorithm_visualizer';
const appEntryPoint = './js/index.js';
......@@ -80,9 +79,9 @@ gulp.task('minify-js', () => {
gutil.log('\n\nBuild JS Paths: \n', jsDir, '\n\n');
return browserify({
entries: './js/index.js',
debug: true
})
entries: './js/index.js',
debug: true
})
.transform('babelify', {
presets: ['es2015']
})
......@@ -105,9 +104,9 @@ gulp.task('build-js', () => {
gutil.log('\n\nBuild JS Paths: \n', jsDir, '\n\n');
return browserify({
entries: './js/index.js',
debug: true
})
entries: './js/index.js',
debug: true
})
.transform('babelify', {
presets: ['es2015']
})
......@@ -131,7 +130,7 @@ gulp.task('build', ['compile-css', 'compile-js']);
// Server
gulp.task('connect', function() {
gulp.task('connect', function () {
connect.server({
port: process.env.PORT || 8080,
......@@ -141,11 +140,20 @@ gulp.task('connect', function() {
// Watch
gulp.task('watch', ['build'], function() {
gulp.task('watch', ['build'], function () {
gulp.watch(jsDir, ['compile-js']);
gulp.watch(cssDir, ['compile-css']);
});
// Heroku Production
gulp.task('prod', ['build'], function () {
connect.server({
port: process.env.PORT || 8080,
livereload: false
});
});
// Default
gulp.task('default', ['connect', 'watch']);
......@@ -4,7 +4,7 @@
"description": "Algorithm Visualizer",
"main": "index.js",
"scripts": {
"start": "gulp",
"start": "gulp prod",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册