Skip to content

Commit

Permalink
feat: expose version
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest committed Mar 7, 2021
1 parent 240a3dc commit 7f47f61
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
>
<header>
<h1>vue-next-select</h1>
<span id="version"></span>
<p><b>The selecting solution for Vue 3</b></p>
<br />

Expand Down Expand Up @@ -392,6 +393,9 @@ <h2 id="events">Events</h2>
<script>
hljs.initHighlightingOnLoad()
</script>
<script>
document.querySelector('#version').innerHTML = `(${VueNextSelect.__VERSION__})`
</script>

<script src="./sticky.js"></script>
</body>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@commitlint/cli": "^12.0.1",
"@commitlint/config-conventional": "^12.0.1",
"@popperjs/core": "^2.4.4",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"@types/jest": "^26.0.15",
"@vue/compiler-sfc": "^3.0.0",
Expand Down
2 changes: 2 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import vue from 'rollup-plugin-vue'
import copy from 'rollup-plugin-copy'
import csso from 'csso'
import svg from 'rollup-plugin-svg'
import json from '@rollup/plugin-json'

rm.sync(path.resolve('dist/**/*'))

Expand All @@ -25,6 +26,7 @@ formats.forEach(format => {
input,
external: ['vue'],
plugins: [
json(),
vue(),
ts({
tsconfig: false,
Expand Down
7 changes: 6 additions & 1 deletion src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ import VDropdown from './components/dropdown.vue'
import { addOption, removeOption, getOptionByValue, hasOption, isSameOption } from './crud'
import normalize from './normalize'
import { useHeight } from './hooks'
import { version } from '../package.json'
export default {
const VueSelect = {
name: 'vue-select',
inheritAttrs: false,
props: {
Expand Down Expand Up @@ -485,4 +486,8 @@ export default {
VDropdown,
},
}
VueSelect.__VERSION__ = version
export default VueSelect
</script>
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,13 @@
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.9.0.tgz#32e63212293dd3efbb521cd35a5020ab66eaa546"
integrity sha512-wjtKehFAIARq2OxK8j3JrggNlEslJfNuSm2ArteIbKyRMts2g0a7KzTxfRVNUM+O0gnBJ2hNV8nWPOYBgI1sew==

"@rollup/plugin-json@^4.1.0":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3"
integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==
dependencies:
"@rollup/pluginutils" "^3.0.8"

"@rollup/plugin-node-resolve@^11.0.0":
version "11.2.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.0.tgz#a5ab88c35bb7622d115f44984dee305112b6f714"
Expand All @@ -1455,7 +1462,7 @@
is-module "^1.0.0"
resolve "^1.19.0"

"@rollup/pluginutils@^3.1.0":
"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
Expand Down

0 comments on commit 7f47f61

Please sign in to comment.