Eduardo San Martin Morote 8 роки тому
батько
коміт
7804b6cb32
3 змінених файлів з 7 додано та 1 видалено
  1. 5 1
      build/rollup.config.js
  2. 1 0
      package.json
  3. 1 0
      src/index.js

+ 5 - 1
build/rollup.config.js

@@ -1,4 +1,5 @@
 const buble = require('rollup-plugin-buble')
+const replace = require('rollup-plugin-replace')
 const version = process.env.VERSION || require('../package.json').version
 
 module.exports = {
@@ -6,7 +7,10 @@ module.exports = {
   dest: 'dist/vuex.js',
   format: 'umd',
   moduleName: 'Vuex',
-  plugins: [buble()],
+  plugins: [
+    replace({ __VERSION__: version }),
+    buble()
+  ],
   banner:
 `/**
  * vuex v${version}

+ 1 - 0
package.json

@@ -57,6 +57,7 @@
     "phantomjs-prebuilt": "^2.1.7",
     "rollup": "^0.34.13",
     "rollup-plugin-buble": "^0.14.0",
+    "rollup-plugin-replace": "^1.1.1",
     "rollup-watch": "^2.5.0",
     "selenium-server": "^2.53.1",
     "todomvc-app-css": "^2.0.3",

+ 1 - 0
src/index.js

@@ -414,6 +414,7 @@ if (typeof window !== 'undefined' && window.Vue) {
 export default {
   Store,
   install,
+  version: '__VERSION__',
   mapState,
   mapMutations,
   mapGetters,