gulp
꿀꺽 경로
수색…
앱에 간단한 꿀꺽 꿀꺽 경로 만들기
꿀꺽 마시고 달리기 전에 Node.JS
와 npm
을 설치해야합니다.
Gulp.js의 책임자는 다음과 같습니다.
var gulp = require('gulp');
clean = require('gulp-clean'); // A gulp plugin for removing files and folders.
imagemin = require('gulp-imagemin'); // Minify PNG, JPEG, GIF and SVG images
그런 다음 꿀꺽 꿀꺽 마신 파일의 경로를 지정하십시오.
var bases = {
app: 'app/', // path to your app
dist: 'dist/', // path to the compiled application
};
var paths = {
scripts: ['scripts/**/*.js', '!scripts/libs/**/*.js'],
libs: ['scripts/libs/jquery/dist/jquery.js', 'scripts/libs/underscore/underscore.js', 'scripts/backbone/backbone.js'],
styles: ['styles/**/*.css'],
html: ['index.html', '404.html'],
images: ['images/**/*.png'],
extras: ['crossdomain.xml', 'humans.txt', 'manifest.appcache', 'robots.txt', 'favicon.ico'],
};
예제 1 :
// Copy all other files to dist directly
gulp.task('copy', ['clean'], function() {
// Copy html
gulp.src(index.html)
.pipe(gulp.dest(bases.dist)); // same as .pipe(gulp.dest('dist'));
});
예 2 :
// Imagemin images and ouput them in dist
gulp.task('imagemin', ['clean'], function() {
gulp.src(paths.images, {cwd: bases.app})
.pipe(imagemin())
.pipe(gulp.dest(bases.dist + 'images/')); // same as .pipe(gulp.dest('dist/images/'));
});
기본 시계
// Define the default task as a sequence of the above tasks
gulp.task('default', ['clean', 'imagemin', 'copy']);
Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow