Skip to content

Commit

Permalink
feat: distribution should have a version #129
Browse files Browse the repository at this point in the history
closes #129
  • Loading branch information
stasson committed Jan 4, 2018
1 parent 9b1395a commit a9bf69d
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 11 deletions.
22 changes: 11 additions & 11 deletions components/base/auto-init.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export function autoInit (plugin) {
// Auto-install
let _Vue = null
if (typeof window !== 'undefined') {
_Vue = window.Vue
} else if (typeof global !== 'undefined') {
/*global global*/
_Vue = global.Vue
}
if (_Vue) {
_Vue.use(plugin)
}
// Auto-install
let _Vue = null
if (typeof window !== 'undefined') {
_Vue = window.Vue
} else if (typeof global !== 'undefined') {
/*global global*/
_Vue = global.Vue
}
if (_Vue) {
_Vue.use(plugin)
}
}

1 change: 1 addition & 0 deletions components/base/base-plugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export function BasePlugin (components) {
return {
version: '__VERSION__',
install: (vm) => {
for (let key in components) {
let component = components[key]
Expand Down
1 change: 1 addition & 0 deletions components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import VueMDCToolbar from './toolbar'
import VueMDCTypography from './typography'

export default {
version: '__VERSION__',
install (vm) {
vm.use(VueMDCButton)
vm.use(VueMDCCard)
Expand Down
29 changes: 29 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-commonjs": "^8.2.6",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-sass": "^0.5.3",
"rollup-plugin-uglify": "^2.0.1",
"rollup-plugin-vue": "^3.0.0",
Expand Down
7 changes: 7 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import postcss from 'postcss'
import csso from 'postcss-csso';
import { minify } from 'uglify-es'
import pkg from './package.json';
import replace from 'rollup-plugin-replace'

const PLUGINS = [
'button',
Expand Down Expand Up @@ -137,6 +138,9 @@ function createUmdConfig(module, env, extract) {
sass(sassConfig),
babel(babelConfig),
commonjs(),
replace({
__VERSION__: pkg.version
}),
],
onwarn
}
Expand Down Expand Up @@ -216,6 +220,9 @@ function createEsmConfig(module) {
resolve({ jsnext: true, main: true, browser: true }),
babel(babelConfig),
commonjs(),
replace({
__VERSION__: pkg.version
}),
],
onwarn
}
Expand Down

0 comments on commit a9bf69d

Please sign in to comment.