@ECHO OFF
>package.json echo {
>>package.json echo "name": "npm_package",
>>package.json echo "version": "1.0.0",
>>package.json echo "main": "index.js",
>>package.json echo "author": "",
>>package.json echo "license": "ISC",
>>package.json echo "devDependencies": {
>>package.json echo "gulp": "*",
>>package.json echo "gulp-concat": "*",
>>package.json echo "gulp-minify-css": "*",
>>package.json echo "gulp-uglify": "*",
>>package.json echo "gulp-html-replace": "*"
>>package.json echo }
>>package.json echo }
>gulpfile.js echo var gulp = require('gulp'),
>>gulpfile.js echo minifyCSS = require('gulp-minify-css'), // Минификация CSS
>>gulpfile.js echo uglify = require('gulp-uglify'), // Минификация JS
>>gulpfile.js echo concat = require('gulp-concat'); // Склейка файлов
>>gulpfile.js echo htmlreplace = require('gulp-html-replace')
>>gulpfile.js echo.
>>gulpfile.js echo.
>>gulpfile.js echo gulp.task('html', function() {
>>gulpfile.js echo gulp.src(['../index.html'])
>>gulpfile.js echo .pipe(htmlreplace({
>>gulpfile.js echo 'css': ['css/main.min.css'],
>>gulpfile.js echo 'js': ['//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', '//cdnjs.cloudflare.com/ajax/libs/three.js/r71/three.min.js', 'js/main.min.js]'
>>gulpfile.js echo }))
>>gulpfile.js echo .pipe(gulp.dest('dist/'));
>>gulpfile.js echo });
>>gulpfile.js echo.
>>gulpfile.js echo gulp.task('css', function() {
>>gulpfile.js echo return gulp.src(['../normalize.css', '../main.css'])
>>gulpfile.js echo .pipe(concat('main.css'))
>>gulpfile.js echo .pipe(minifyCSS({
>>gulpfile.js echo compatibility: 'ie8'
>>gulpfile.js echo }))
>>gulpfile.js echo .pipe(gulp.dest('build/css'))
>>gulpfile.js echo });
>>gulpfile.js echo.
>>gulpfile.js echo gulp.task('js', function() {
>>gulpfile.js echo return gulp.src(['../main.js'])
>>gulpfile.js echo .pipe(concat('main.js'))
>>gulpfile.js echo .pipe(uglify())
>>gulpfile.js echo .pipe(gulp.dest('build/js'))
>>gulpfile.js echo });
>>gulpfile.js echo.
>>gulpfile.js echo.
>>gulpfile.js echo gulp.task('default', ['css', 'js', 'html']);
gulpupdate.bat