Skip to content

Add docsify version to $window.docsify object #641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add docsify version to $window.docsify object
Fix #521
  • Loading branch information
jhildenbiddle committed Oct 9, 2018
commit f61a8b1375c40c57f78de72ea6163313061fd69e
2 changes: 2 additions & 0 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ const isProd = process.env.NODE_ENV === 'production'
const version = process.env.VERSION || require('../package.json').version
const chokidar = require('chokidar')
const path = require('path')
const json = require('rollup-plugin-json')

const build = function(opts) {
rollup
.rollup({
input: opts.input,
plugins: (opts.plugins || []).concat([
json(),
buble(),
commonjs(),
nodeResolve(),
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"rollup-plugin-async": "^1.2.0",
"rollup-plugin-buble": "^0.18.0",
"rollup-plugin-commonjs": "^8.2.6",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-uglify": "^2.0.1",
Expand Down
2 changes: 2 additions & 0 deletions src/core/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {merge, hyphenate, isPrimitive, hasOwn} from './util/core'
import {version as pkgVersion} from './../../package.json'

export default function () {
const config = merge(
Expand Down Expand Up @@ -64,6 +65,7 @@ export default function () {
}
}

config.version = pkgVersion
window.$docsify = config

return config
Expand Down