Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
lrsjng committed Mar 30, 2019
1 parent 294813f commit 94086ff
Show file tree
Hide file tree
Showing 4 changed files with 2,939 additions and 2,108 deletions.
4 changes: 2 additions & 2 deletions dist/pagemap.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions ghu.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const {resolve, join} = require('path');
const {ghu, jszip, mapfn, read, remove, run, uglify, webpack, wrap, write} = require('ghu');
const {ghu, jszip, mapfn, read, remove, uglify, webpack, wrap, write} = require('ghu');

const NAME = 'pagemap';

Expand All @@ -22,24 +22,23 @@ ghu.task('clean', () => {
return remove(`${BUILD}, ${DIST}`);
});

ghu.task('lint', () => {
return run('eslint .', {stdio: 'inherit'});
});

ghu.task('build:script', runtime => {
const webpackConfig = {
mode: 'none',
output: {
library: NAME,
libraryTarget: 'umd'
libraryTarget: 'umd',
umdNamedDefine: true,
globalObject: '(typeof self !== \'undefined\' ? self : this)'
},
module: {
loaders: [
rules: [
{
include: [SRC],
loader: 'babel-loader',
query: {
cacheDirectory: true,
presets: ['env']
presets: ['@babel/preset-env']
}
}
]
Expand All @@ -48,7 +47,7 @@ ghu.task('build:script', runtime => {

return read(`${SRC}/${NAME}.js`)
.then(webpack(webpackConfig, {showStats: false}))
.then(uglify({compressor: {warnings: false}}))
.then(uglify())
.then(wrap(runtime.commentJs))
.then(write(`${DIST}/${NAME}.min.js`, {overwrite: true}))
.then(write(`${BUILD}/${NAME}-${runtime.pkg.version}.min.js`, {overwrite: true}));
Expand Down
Loading

0 comments on commit 94086ff

Please sign in to comment.