Skip to content

Commit ff54558

Browse files
committed
Update.
1 parent e36c0d0 commit ff54558

File tree

12 files changed

+389
-2127
lines changed

12 files changed

+389
-2127
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
/coverage/
33
/dist/
44
/node_modules/
5-
/**/vendor/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/build/
2+
/coverage/
23
/local/
34
/node_modules/
45
/npm-debug.log

dist/kjua.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ghu.js

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
const {resolve, join} = require('path');
2-
const {ghu, includeit, jszip, mapfn, pug, read, remove, uglify, webpack, wrap, write} = require('ghu');
2+
const {ghu, jszip, mapfn, pug, read, remove, uglify, webpack, wrap, write} = require('ghu');
33

44
const NAME = 'kjua';
55

66
const ROOT = resolve(__dirname);
77
const SRC = join(ROOT, 'src');
8-
const DEMO = join(SRC, 'demo');
98
const BUILD = join(ROOT, 'build');
109
const DIST = join(ROOT, 'dist');
1110

@@ -24,30 +23,35 @@ ghu.task('clean', () => {
2423

2524
ghu.task('build:script', runtime => {
2625
return read(`${SRC}/${NAME}.js`)
27-
.then(webpack(webpack.cfg_umd(NAME, [SRC]), {showStats: false}))
28-
.then(includeit())
26+
.then(webpack(webpack.cfg_umd(NAME, [SRC])))
2927
.then(uglify())
3028
.then(wrap(runtime.commentJs))
3129
.then(write(`${DIST}/${NAME}.min.js`, {overwrite: true}))
3230
.then(write(`${BUILD}/${NAME}-${runtime.pkg.version}.min.js`, {overwrite: true}));
3331
});
3432

35-
ghu.task('build:copy', () => {
36-
return read(`${ROOT}/*.md`)
37-
.then(write(mapfn.p(ROOT, BUILD), {overwrite: true}));
38-
});
39-
40-
ghu.task('build:demo', runtime => {
33+
ghu.task('build:other', runtime => {
34+
const mapper = mapfn.p(SRC, BUILD).s('.pug', '');
4135
return Promise.all([
42-
read(`${DEMO}/*.pug`)
36+
read(`${ROOT}/*.md`)
37+
.then(write(mapfn.p(ROOT, BUILD), {overwrite: true})),
38+
39+
read(`${SRC}/demo/*.pug`)
40+
.then(pug({pkg: runtime.pkg}))
41+
.then(write(mapper, {overwrite: true})),
42+
read(`${SRC}/demo: *, !*.pug`)
43+
.then(write(mapper, {overwrite: true})),
44+
45+
read(`${SRC}/test/*.pug`)
4346
.then(pug({pkg: runtime.pkg}))
44-
.then(write(mapfn.p(SRC, BUILD).s('.pug', ''), {overwrite: true})),
45-
read(`${DEMO}: *, !*.pug`)
46-
.then(write(mapfn.p(SRC, BUILD), {overwrite: true}))
47+
.then(write(mapper, {overwrite: true})),
48+
read(`${SRC}/test/*.js`)
49+
.then(webpack(webpack.cfg([SRC])))
50+
.then(write(mapper, {overwrite: true}))
4751
]);
4852
});
4953

50-
ghu.task('build', ['build:script', 'build:copy', 'build:demo']);
54+
ghu.task('build', ['build:script', 'build:other']);
5155

5256
ghu.task('zip', ['build'], runtime => {
5357
return read(`${BUILD}/**`)

0 commit comments

Comments
 (0)