Created
December 10, 2018 11:14
-
-
Save matheusmurta/0ecc2689f8be8aadb646983362e26b1f to your computer and use it in GitHub Desktop.
gulp config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const gulp = require("gulp") | |
| const concat = require('gulp-concat') | |
| const watch = require('gulp-watch') | |
| const embedTemplates = require('gulp-angular-embed-templates') | |
| const concatCss = require('gulp-concat-css') | |
| const del = require('del') | |
| const runSequence = require('run-sequence') | |
| const terser = require('gulp-terser') | |
| const _distFolder = './dist' | |
| const allFiles = './src/**/*' | |
| const jsFiles = './src/**/*.js' | |
| const cssFiles = './src/**/*.css' | |
| const bundleJsName = 'table.min.js' | |
| const bundleCssName = 'table.min.css' | |
| const buildJs = () => { | |
| return gulp.src(jsFiles) | |
| .pipe(embedTemplates()) | |
| .pipe(concat(bundleJsName)) | |
| .pipe(terser()) | |
| .pipe(gulp.dest(_distFolder)) | |
| } | |
| const buildCss = () => { | |
| return gulp.src(cssFiles) | |
| .pipe(concatCss(bundleCssName)) | |
| .pipe(gulp.dest(_distFolder)) | |
| } | |
| /* Delete dist files */ | |
| gulp.task('clean', () => del(_distFolder + '/**/*', { force: true })) | |
| gulp.task('build-css', buildCss) | |
| gulp.task('build-js', buildJs) | |
| gulp.task('watch-js', () => watch(allFiles, { ignoreInitial: false }, buildJs)) | |
| gulp.task('watch-css', () => watch(allFiles, { ignoreInitial: false }, buildCss)) | |
| gulp.task('watch', () => runSequence('clean', ['watch-css', 'watch-js'])) | |
| gulp.task('default', () => runSequence('clean', ['build-css', 'build-js'])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "@xst/component-table", | |
| "version": "1.1.0", | |
| "description": "Table", | |
| "main": "index.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, | |
| "devDependencies": { | |
| "@babel/core": "^7.1.2", | |
| "@babel/preset-env": "^7.1.0", | |
| "del": "^2.2.2", | |
| "gulp": "^3.9.1", | |
| "gulp-angular-embed-templates": "^2.3.0", | |
| "gulp-concat": "^2.6.1", | |
| "gulp-concat-css": "^2.3.0", | |
| "gulp-terser": "^1.1.5", | |
| "gulp-watch": "^5.0.0", | |
| "run-sequence": "^1.2.2" | |
| }, | |
| "keywords": [ | |
| "table", | |
| "md", | |
| "angularjs" | |
| ], | |
| "author": "Matheus Murta", | |
| "license": "ISC" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment