From 1f32f504acfeb9dcce0c5342d25301069d4e7d2c Mon Sep 17 00:00:00 2001 From: Yama Date: Sun, 26 Aug 2018 18:00:11 +0900 Subject: [PATCH 1/4] =?UTF-8?q?modify:=20webpack=20=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E6=99=82=E3=81=AB=E5=87=A6=E7=90=86=E3=81=8C=E6=AD=A2?= =?UTF-8?q?=E3=82=81=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index eb4c4eb..2813856 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -81,9 +81,9 @@ gulp.task('sass-sp', function() { gulp.task('webpack', function() { return webpackStream(webpackConfig, webpack) - .pipe(plumber({ - errorHandler: notify.onError('Error: <%= error.message %>') - })) + .on('error', function handleError() { + this.emit('end'); + }) .pipe(gulpif(!isProd, gulp.dest(destDir))) .pipe(gulpif(isProd, gulp.dest(prodDir))) }); From 209f0e87d233d8b2916cd3421ffe22bd38fccba4 Mon Sep 17 00:00:00 2001 From: Yama Date: Sun, 26 Aug 2018 18:03:08 +0900 Subject: [PATCH 2/4] =?UTF-8?q?modify:=20var=20=E2=86=92=20const,=20let=20?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 2813856..a4db5c6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,31 +1,31 @@ -var gulp = require('gulp'); -var sass = require('gulp-sass'); -var autoprefixer = require('gulp-autoprefixer'); -var ejs = require('gulp-ejs'); -var concat = require('gulp-concat'); -var uglify = require('gulp-uglify'); -var cleanCss = require('gulp-clean-css'); -var watch = require('gulp-watch'); -var plumber = require('gulp-plumber'); -var notify = require('gulp-notify'); -var cache = require('gulp-cached'); -var changed = require('gulp-changed'); -var rename = require('gulp-rename'); -var gulpif = require('gulp-if'); -var minimist = require('minimist'); -var del = require('del'); -var browserSync = require('browser-sync').create(); -var runSequence = require('run-sequence'); -var webpackStream = require('webpack-stream'); -var webpack = require('webpack'); -var destDir = './dist/'; -var prodDir = './htdocs/'; -var options = minimist(process.argv.slice(2), config); -var config = { +const gulp = require('gulp'); +const sass = require('gulp-sass'); +const autoprefixer = require('gulp-autoprefixer'); +const ejs = require('gulp-ejs'); +const concat = require('gulp-concat'); +const uglify = require('gulp-uglify'); +const cleanCss = require('gulp-clean-css'); +const watch = require('gulp-watch'); +const plumber = require('gulp-plumber'); +const notify = require('gulp-notify'); +const cache = require('gulp-cached'); +const changed = require('gulp-changed'); +const rename = require('gulp-rename'); +const gulpif = require('gulp-if'); +const minimist = require('minimist'); +const del = require('del'); +const browserSync = require('browser-sync').create(); +const runSequence = require('run-sequence'); +const webpackStream = require('webpack-stream'); +const webpack = require('webpack'); +const destDir = './dist/'; +const prodDir = './htdocs/'; +const config = { string: 'env', default: { env: process.env.NODE_ENV || 'dev'} } -var isProd = (options.env === 'prod') ? true : false; +const options = minimist(process.argv.slice(2), config); +let isProd = (options.env === 'prod') ? true : false; console.log('[build env]', options.env, '[isProd]', isProd); const webpackConfig = require('./webpack.config'); From 5ed8035145cd1568463facc34f8c2802a1986b1a Mon Sep 17 00:00:00 2001 From: Yama Date: Sun, 26 Aug 2018 18:03:56 +0900 Subject: [PATCH 3/4] =?UTF-8?q?modify:=20=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index a4db5c6..a617a19 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -50,8 +50,8 @@ gulp.task('sass', function() { path.dirname = 'css' })) .pipe(autoprefixer({ - browsers: ['last 2 version', 'iOS >= 9', 'Android >= 4.6'], - cascade: false + browsers: ['last 2 version', 'iOS >= 9', 'Android >= 4.6'], + cascade: false })) .pipe(gulpif(isProd, cleanCss())) .pipe(gulpif(!isProd, gulp.dest(destDir))) @@ -70,8 +70,8 @@ gulp.task('sass-sp', function() { path.dirname = 'css' })) .pipe(autoprefixer({ - browsers: ['last 2 version', 'iOS >= 9', 'Android >= 4.6'], - cascade: false + browsers: ['last 2 version', 'iOS >= 9', 'Android >= 4.6'], + cascade: false })) .pipe(gulpif(isProd, cleanCss())) .pipe(gulpif(!isProd, gulp.dest(destDir + 'sp/'))) From 8e1fc1b43cd87fd7e6a99dc596c2d47ff242db10 Mon Sep 17 00:00:00 2001 From: Yama Date: Sun, 26 Aug 2018 18:08:13 +0900 Subject: [PATCH 4/4] modify: udpate version --- README.md | 5 ++++- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 84377e0..2f7724b 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,10 @@ webpack追加。coffeeのタスク削除。ejsと画像タスク修正。 jsファイルを1ファイルにまとめられるように変更。 ### ver 9.0.0 -es2015対応 +es2015対応 + +### ver 9.0.1 +webpackのエラーの際にwatchが停止しないようにタスクを修正。 ### 使い方と仕様 diff --git a/package-lock.json b/package-lock.json index a6ae470..754f9e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ejs_template", - "version": "9.0.0", + "version": "9.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b57a01f..a21f0f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ejs_template", - "version": "9.0.0", + "version": "9.0.1", "description": "ejsでのテンプレート", "main": "index.js", "dependencies": {