chore(build): remove Gulp & co.
This commit is contained in:
parent
b835c5bd40
commit
b5a139619a
70
gulpfile.js
70
gulpfile.js
@ -1,70 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
const gulp = require('gulp')
|
||||
|
||||
const babel = require('gulp-babel')
|
||||
const coffee = require('gulp-coffee')
|
||||
const plumber = require('gulp-plumber')
|
||||
const rimraf = require('rimraf')
|
||||
const sourceMaps = require('gulp-sourcemaps')
|
||||
const watch = require('gulp-watch')
|
||||
|
||||
const join = require('path').join
|
||||
|
||||
// ===================================================================
|
||||
|
||||
const SRC_DIR = join(__dirname, 'src')
|
||||
const DIST_DIR = join(__dirname, 'dist')
|
||||
|
||||
const PRODUCTION = process.argv.indexOf('--production') !== -1
|
||||
|
||||
// ===================================================================
|
||||
|
||||
function src (patterns) {
|
||||
return PRODUCTION
|
||||
? gulp.src(patterns, {
|
||||
base: SRC_DIR,
|
||||
cwd: SRC_DIR,
|
||||
})
|
||||
: watch(patterns, {
|
||||
base: SRC_DIR,
|
||||
cwd: SRC_DIR,
|
||||
ignoreInitial: false,
|
||||
verbose: true,
|
||||
})
|
||||
.pipe(plumber())
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
gulp.task(function clean (cb) {
|
||||
rimraf(DIST_DIR, cb)
|
||||
})
|
||||
|
||||
gulp.task(function buildCoffee () {
|
||||
return src('**/*.coffee')
|
||||
.pipe(sourceMaps.init())
|
||||
.pipe(coffee({
|
||||
bare: true,
|
||||
}))
|
||||
|
||||
// Necessary to correctly compile generators.
|
||||
.pipe(babel())
|
||||
|
||||
.pipe(sourceMaps.write('.'))
|
||||
.pipe(gulp.dest(DIST_DIR))
|
||||
})
|
||||
|
||||
gulp.task(function buildEs6 () {
|
||||
return src([ '**/*.js', '!*.spec.js' ])
|
||||
.pipe(sourceMaps.init())
|
||||
.pipe(babel())
|
||||
.pipe(sourceMaps.write('.'))
|
||||
.pipe(gulp.dest(DIST_DIR))
|
||||
})
|
||||
|
||||
// ===================================================================
|
||||
|
||||
gulp.task('build', gulp.series('clean', gulp.parallel('buildCoffee', 'buildEs6')))
|
15
package.json
15
package.json
@ -119,6 +119,7 @@
|
||||
"xo-vmdk-to-vhd": "0.0.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-core": "^6.26.0",
|
||||
"babel-eslint": "^8.0.3",
|
||||
"babel-plugin-lodash": "^3.3.2",
|
||||
@ -126,29 +127,25 @@
|
||||
"babel-plugin-transform-runtime": "^6.23.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-preset-stage-0": "^6.24.1",
|
||||
"cross-env": "^5.1.3",
|
||||
"eslint": "^4.13.1",
|
||||
"eslint-config-standard": "^11.0.0-beta.0",
|
||||
"eslint-plugin-import": "^2.8.0",
|
||||
"eslint-plugin-node": "^5.2.1",
|
||||
"eslint-plugin-promise": "^3.6.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"gulp": "git://github.com/gulpjs/gulp#4.0",
|
||||
"gulp-babel": "^7.0.0",
|
||||
"gulp-coffee": "^2.3.5",
|
||||
"gulp-plumber": "^1.1.0",
|
||||
"gulp-sourcemaps": "^2.6.1",
|
||||
"gulp-watch": "^4.3.11",
|
||||
"husky": "^0.14.3",
|
||||
"index-modules": "^0.3.0",
|
||||
"jest": "^22.0.3",
|
||||
"rimraf": "^2.6.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "gulp build --production",
|
||||
"build": "cross-env NODE_ENV=production babel --source-maps --out-dir=dist/ src/",
|
||||
"clean": "rimraf dist/",
|
||||
"commitmsg": "yarn run test",
|
||||
"dev": "gulp build",
|
||||
"dev": "cross-env NODE_ENV=development babel --watch --source-maps --out-dir=dist/ src/",
|
||||
"dev-test": "jest --bail --watch",
|
||||
"prebuild": "index-modules src/api src/xapi/mixins src/xo-mixins",
|
||||
"prebuild": "index-modules src/api src/xapi/mixins src/xo-mixins && yarn run clean",
|
||||
"predev": "yarn run prebuild",
|
||||
"prepublishOnly": "yarn run build",
|
||||
"pretest": "eslint --ignore-path .gitignore --fix .",
|
||||
|
Loading…
Reference in New Issue
Block a user