mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-23 03:27:08 -04:00
Begin to move all src javascript to es6. Add search/filter ignore case option.
This commit is contained in:
parent
f37e8e7b89
commit
7ec2bdf16a
58 changed files with 3546 additions and 3420 deletions
23
ghu.js
23
ghu.js
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue