Created gulp task `compile-es5-lib` (WIP, not yet compiling less into css)
This commit is contained in:
parent
349e6015a3
commit
d2e1bed9d6
2
.babelrc
2
.babelrc
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"presets": ["es2015", "stage-3", "stage-2"],
|
||||
"presets": ["es2015", "stage-2"],
|
||||
"plugins": ["transform-flow-strip-types"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
.idea
|
||||
dist
|
||||
lib
|
||||
downloads
|
||||
node_modules
|
||||
flow-typed
|
||||
|
|
21
gulpfile.js
21
gulpfile.js
|
@ -4,6 +4,7 @@ const gulpMultiProcess = require('gulp-multi-process')
|
|||
const gutil = require('gulp-util')
|
||||
const shell = require('gulp-shell')
|
||||
const mkdirp = require('mkdirp')
|
||||
const babel = require('gulp-babel')
|
||||
const webpack = require('webpack')
|
||||
const browserSync = require('browser-sync').create()
|
||||
|
||||
|
@ -25,6 +26,7 @@ const ENTRY = './src/index.js'
|
|||
const ENTRY_REACT = './src/components/JSONEditor.js'
|
||||
const HEADER = './src/header.js'
|
||||
const DIST = './dist'
|
||||
const LIB = './lib'
|
||||
const EMPTY = __dirname + '/src/utils/empty.js'
|
||||
|
||||
// generate banner with today's date and correct version
|
||||
|
@ -187,6 +189,7 @@ function createBundleTask (compiler) {
|
|||
// make dist folder
|
||||
gulp.task('mkdir', function () {
|
||||
mkdirp.sync(DIST)
|
||||
mkdirp.sync(LIB)
|
||||
})
|
||||
|
||||
// bundle javascript
|
||||
|
@ -195,10 +198,25 @@ gulp.task('bundle', ['mkdir'], createBundleTask(compiler))
|
|||
// bundle minimalist version of javascript
|
||||
gulp.task('bundle-minimalist', ['mkdir'], createBundleTask(compilerMinimalist))
|
||||
|
||||
// compile the source code into es5 code
|
||||
gulp.task('compile-es5-lib', ['mkdir'], function () {
|
||||
// TODO: compile *.less too
|
||||
return gulp
|
||||
.src([
|
||||
'src/**/*.js',
|
||||
'!src/flow/**/*.js',
|
||||
'!src/resources/**/*.js'
|
||||
])
|
||||
.pipe(babel())
|
||||
.pipe(gulp.dest(LIB));
|
||||
})
|
||||
|
||||
// bundle react version
|
||||
// TODO: remove bundle-react again? (use ./lib instead)
|
||||
gulp.task('bundle-react', ['mkdir'], createBundleTask(compilerReact))
|
||||
|
||||
// bundle react minimalist version
|
||||
// TODO: remove bundle-react-minimalist again? (use ./lib instead)
|
||||
gulp.task('bundle-react-minimalist', ['mkdir'], createBundleTask(compilerReactMinimalist))
|
||||
|
||||
// TODO: zip file using archiver
|
||||
|
@ -233,7 +251,6 @@ gulp.task('default', function(done) {
|
|||
return gulpMultiProcess([
|
||||
'bundle',
|
||||
'bundle-minimalist',
|
||||
'bundle-react',
|
||||
'bundle-react-minimalist'
|
||||
'compile-es5-lib'
|
||||
], done);
|
||||
})
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
"flow-bin": "0.36.0",
|
||||
"graceful-fs": "4.1.11",
|
||||
"gulp": "3.9.1",
|
||||
"gulp-babel": "6.1.2",
|
||||
"gulp-multi-process": "0.1.0",
|
||||
"gulp-shell": "0.5.2",
|
||||
"gulp-util": "3.0.7",
|
||||
|
|
Loading…
Reference in New Issue