Begin to move all src javascript to es6. Add search/filter ignore case option.

This commit is contained in:
Lars Jung 2016-06-02 23:16:23 +02:00
parent f37e8e7b89
commit 7ec2bdf16a
58 changed files with 3546 additions and 3420 deletions

23
ghu.js
View file

@ -1,7 +1,7 @@
const {resolve, join} = require('path');
const {
ghu, autoprefixer, cssmin, each, ife, includeit, jszip, less, mapfn,
newerThan, pug, read, remove, run, uglify, watch, wrap, write
newerThan, pug, read, remove, run, uglify, watch, webpack, wrap, write
} = require('ghu');
const ROOT = resolve(__dirname);
@ -49,8 +49,27 @@ ghu.task('lint', 'lint all JavaScript files with eslint', () => {
});
ghu.task('build:scripts', runtime => {
return read(`${SRC}/_h5ai/public/js/*.js`)
const webpackConfig = {
output: {},
module: {
loaders: [
{
include: [SRC],
loader: 'babel',
query: {
presets: ['es2015'],
cacheDirectory: true
}
}
],
presets: ['es2015']
}
};
return read(`${SRC}/_h5ai/public/js/scripts.js`)
.then(newerThan(mapper, `${SRC}/_h5ai/public/js/**`))
.then(webpack(webpackConfig, {showStats: true}))
.then(wrap('\n\n// @include "vendor/*"\n\n'))
.then(includeit())
.then(ife(() => runtime.args.production, uglify()))
.then(wrap(runtime.commentJs))