Commit ed1ca6a4 authored by wildfirecode13's avatar wildfirecode13

1

parent 49b58b57
node_modules
out
\ No newline at end of file
docs
\ No newline at end of file
const gulp = require('gulp')
const typedoc = require('gulp-typedoc')
const browserSync = require('browser-sync').create()
const runTypeDoc = () => gulp
.src(['src'])
.pipe(typedoc({
out: './docs',
// 这个文件里都是 export * from '...' 就没必要导出文档了
exclude: 'src/index.ts',
tsconfig: 'tsconfig.json',
}))
const reload = (done) => {
browserSync.reload()
done()
}
const runBrowserSync = (done) => {
browserSync.init({
server: {
baseDir: './docs',
},
})
done()
}
const watch = () => gulp.watch(
['README.md', 'src/*.ts'],
gulp.series(runTypeDoc, reload)
)
gulp.task('default', gulp.series(runTypeDoc, runBrowserSync, watch))
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,7 +6,8 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"buildDoc":"jsdoc",
"buildDoc": "jsdoc",
"watchDoc": "gulp",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
......@@ -16,7 +17,10 @@
"author": "",
"license": "ISC",
"devDependencies": {
"jsdoc": "^3.6.6",
"browser-sync": "^2.26.13",
"gulp": "^4.0.2",
"gulp-typedoc": "^2.2.5",
"typedoc": "^0.19.2",
"typescript": "^4.0.5"
}
}
}
\ No newline at end of file
/**
* 加法函数
* @param {string} a
* @param {string} b
*/
function add(a, b) {
return a + b
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment