feat: Add docsify version to $window.docsify object (#641)
Fix #521 Please makes sure these boxes are checked before submitting your PR, thank you! * [ x ] Make sure you are merging your commits to `master` branch. * [ x ] Add some descriptions and refer relative issues for you PR. * [ x ] DO NOT include files inside `lib` directory.
This commit is contained in:
parent
9e860177cb
commit
94bc415534
4 changed files with 4013 additions and 4052 deletions
|
|
@ -8,12 +8,14 @@ const isProd = process.env.NODE_ENV === 'production'
|
||||||
const version = process.env.VERSION || require('../package.json').version
|
const version = process.env.VERSION || require('../package.json').version
|
||||||
const chokidar = require('chokidar')
|
const chokidar = require('chokidar')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
const json = require('rollup-plugin-json')
|
||||||
|
|
||||||
const build = function(opts) {
|
const build = function(opts) {
|
||||||
rollup
|
rollup
|
||||||
.rollup({
|
.rollup({
|
||||||
input: opts.input,
|
input: opts.input,
|
||||||
plugins: (opts.plugins || []).concat([
|
plugins: (opts.plugins || []).concat([
|
||||||
|
json(),
|
||||||
buble(),
|
buble(),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
nodeResolve(),
|
nodeResolve(),
|
||||||
|
|
|
||||||
8060
package-lock.json
generated
8060
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -65,6 +65,7 @@
|
||||||
"rollup-plugin-async": "^1.2.0",
|
"rollup-plugin-async": "^1.2.0",
|
||||||
"rollup-plugin-buble": "^0.18.0",
|
"rollup-plugin-buble": "^0.18.0",
|
||||||
"rollup-plugin-commonjs": "^8.2.6",
|
"rollup-plugin-commonjs": "^8.2.6",
|
||||||
|
"rollup-plugin-json": "^3.1.0",
|
||||||
"rollup-plugin-node-resolve": "^3.0.0",
|
"rollup-plugin-node-resolve": "^3.0.0",
|
||||||
"rollup-plugin-replace": "^2.0.0",
|
"rollup-plugin-replace": "^2.0.0",
|
||||||
"rollup-plugin-uglify": "^2.0.1",
|
"rollup-plugin-uglify": "^2.0.1",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import {merge, hyphenate, isPrimitive, hasOwn} from './util/core'
|
import {merge, hyphenate, isPrimitive, hasOwn} from './util/core'
|
||||||
|
import {version as pkgVersion} from './../../package.json'
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
const config = merge(
|
const config = merge(
|
||||||
|
|
@ -64,6 +65,7 @@ export default function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config.version = pkgVersion
|
||||||
window.$docsify = config
|
window.$docsify = config
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue