0.0.2 • Published 9 years ago

gulp-factory-loader v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 years ago

gulp-factory-loader

npm license dependencies

Load and configure gulp tasks with a particular build structure.

$ npm install gulp-factory-loader --save

Usage

Directory Structure

|-project
||-build
| |-index.js
| |-lint.js
| \-test.js
|\-src
| \-index.js
\-gulpfile.js

index.js

module.exports = require('gulp-factory-loader')(__dirname, __filename);

gulpfile.js

require('./build')(require('gulp'), {
	path: '.',

	files: {
		all: [
			'<%= config.path %>/**/*'
		],

		js: [
			'<%= config.path %>/**/*.js',
			'!./node_modules/**',
			'!./bower_components/**'
		]
	},

	eslintrc: '<%= config.path %>/.eslintrc'
}, [
	// optional
	// require other tasks not in the build directory
	
	// require('other-task')
]);

Task Module (lint.js)

var gulpEslint = require('gulp-eslint');

module.exports = function (gulp, config) {
	gulp.task('lint', 'Lint all Javascript files', function () {
		gulp.src(config.files.js)
			.pipe(gulpEslint(config.files.eslintrc))
			.pipe(gulpEslint.formatEach('stylish', process.stderr));
	});
};
0.0.2

9 years ago

0.0.1

9 years ago