Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/vuex
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 03b386ea4e964ecd2cf816cb4141acf34b2ef81c
Choose a base ref
...
head repository: vuejs/vuex
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d2703385b3e0ee64544efd9e7d8ffc28f8c05bcd
Choose a head ref

Commits on Apr 18, 2017

  1. Update getting-started.md (#738)

    ALPIXELMaiki authored and posva committed Apr 18, 2017
    Copy the full SHA
    4a21381 View commit details

Commits on Apr 19, 2017

  1. Copy the full SHA
    1b889aa View commit details
  2. Russian Translation Update (#746)

    * russian docs translation started
    
    * docs/ru/actions.md translated
    
    * docs/ru/api.md translated
    
    * docs/ru/forms.md translated
    
    * api translation fix
    
    * docs/ru/getters.md translated
    
    * docs/ru/getting-started.md translated
    
    * docs/ru/hot-reload.md translated
    
    * docs/ru/installation.md translated
    
    * docs/ru/intro.md translated
    
    * docs/ru/modules.md translated
    
    * docs/ru/README.md translated
    
    * docs/ru/strict.md translated
    
    * docs/ru/structure.md translated
    
    * docs/ru/SUMMARY.md translated (O_O for some reason it happens to be exactly the same as README.md)
    
    * docs/ru/mutations.md translated
    
    * docs/ru/plugins.md translated
    
    * docs/ru/state.md translated
    
    * docs/ru/testing.md translated
    
    * docs/ru/actions.md styling/proof-reading
    
    * docs/ru/api.md styling/proof-reading
    
    * docs/ru/forms.md styling/proof-reading
    
    * docs/ru/getters.md styling/proof-reading
    
    * docs/ru/getting-started.md styling/proof-reading
    
    * docs/ru/hot-reload.md styling/proof-reading
    
    * docs/ru/installation.md styling/proof-reading
    
    * docs/ru/intro.md styling/proof-reading
    
    * docs/ru/modules.md styling/proof-reading
    
    * docs/ru/mutations.md styling/proof-reading
    
    * docs/ru/plugins.md styling/proof-reading
    
    * docs/ru/state.md styling/proof-reading
    
    * docs/ru/strict.md styling/proof-reading
    
    * docs/ru/structure.md styling/proof-reading
    
    * docs/ru/testing.md styling/proof-reading
    
    * docs/ru/intro.md typo fix
    
    * Copyediting RU documentation
    
    * Fix typo
    
    * Change wording around alternative approaches to data handling
    
    * Fix typo
    
    * Fix typo
    
    * Better wording for linters
    
    * Fix header and change wording
    
    * fix typo
    
    * typos reported by @ipelekhan are fixed
    
    * Russian docs translation update
    
    * Fix typo
    
    * Sentence rephrasing and fix punctuation
    
    * Переключил на ветку translation-ru
    
    * - Исправлен пример
    
    * - getting-started.md исправлена ссылка на jsfiddle
    
    * - getters.md добавлена секция про возможность передачи функции в геттерах
    
    * - installation.md добавлен флаг --save
    
    * - modules.md мелкая правка в примере
    
    * Update modules.md
    
    * modules.md ещё мелкая правка в примере
    
    * modules.md добавлен пример регистрации модуля
    
    #634
    
    * actions.md расширен пример
    
    * getters.md исправление
    
    * strict.md обновление и добавлено уточнение о затратности
    
    * testing.md исправлен пример конфига webpack
    
    * api.md изменены ссылки
    
    * intro.md изменена ссылка
    
    * state.md изменена ссылка
    
    * api.md добавлены уточнения при определении в модуле
    
    * mutations.md добавлено уточнение примера
    
    * modules.md обновление 2.3.0
    
    * api.md исправлена ошибка
    
    * plugins.md добавлено уточнение в пример
    
    * modules.md исправлена опечатка
    
    * api.md добавлены описания options для dispatch/commit
    gbezyuk authored and ktsn committed Apr 19, 2017
    Copy the full SHA
    8cba988 View commit details

Commits on Apr 20, 2017

  1. Copy the full SHA
    de4e138 View commit details

Commits on Apr 27, 2017

  1. Super minor grammer fix (#756)

    retzloff authored and ktsn committed Apr 27, 2017
    Copy the full SHA
    daac9b2 View commit details

Commits on Apr 28, 2017

  1. Fix grammatical error. (#758)

    axle07 authored and ktsn committed Apr 28, 2017
    Copy the full SHA
    b9ea69a View commit details

Commits on Apr 29, 2017

  1. Fix superfluous translation (#762)

    iRockyZhou authored and ktsn committed Apr 29, 2017
    Copy the full SHA
    18a3a10 View commit details

Commits on May 2, 2017

  1. fixed typos (#764)

    * fixed typos
    
    * fix typos from bad english... sorry guys
    JojoJohnDoe authored and posva committed May 2, 2017
    Copy the full SHA
    a5f27c5 View commit details

Commits on May 9, 2017

  1. Review of installation.md (#768)

    Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
    MachinisteWeb authored and posva committed May 9, 2017
    Copy the full SHA
    1344e73 View commit details

Commits on May 11, 2017

  1. Copy the full SHA
    7aad4a3 View commit details

Commits on May 14, 2017

  1. Add a try-catch to the testAction helper method example (#776)

    When an error occurs in an assertion, you receive the message that your promise hook was not closed within 2 seconds.
    By catching the error, we can call done(error) (this works for standard vue-cli template)
    1. This makes sure the test is properly closed
    2. The assertion error is logged to the console
    mark-de-haan authored and ktsn committed May 14, 2017
    Copy the full SHA
    665f60c View commit details
  2. port #776 to all lang

    ktsn committed May 14, 2017
    Copy the full SHA
    139dfec View commit details
  3. fix .toggle-all checkbox was hidden (#761)

    huguangju authored and ktsn committed May 14, 2017
    Copy the full SHA
    cc5fc79 View commit details
  4. [improvement] Add assertion to verify using of new (#698)

    * [improvement] Add assertion to verify using of new
    
    I see people are asking about this problem so often, that
    I feel it worth to put this assertion into the code to
    save some time for those developers.
    
    * [fix] Revert dist folder
    termosa authored and ktsn committed May 14, 2017
    Copy the full SHA
    e0504cc View commit details

Commits on May 15, 2017

  1. Add assertions of module assets

    ktsn authored and yyx990803 committed May 15, 2017
    Copy the full SHA
    a7a775b View commit details
  2. Copy the full SHA
    bb8ba9e View commit details
  3. replace env vars during compile time

    ktsn authored and yyx990803 committed May 15, 2017
    Copy the full SHA
    683a6ca View commit details
  4. import commonjs build for unit test

    ktsn authored and yyx990803 committed May 15, 2017
    Copy the full SHA
    45c471c View commit details
  5. make all assertions/warnings be dev only

    ktsn authored and yyx990803 committed May 15, 2017
    Copy the full SHA
    46a88b2 View commit details
  6. tweak config name

    ktsn authored and yyx990803 committed May 15, 2017
    Copy the full SHA
    fdf4d0f View commit details
  7. Copy the full SHA
    7409d4f View commit details
  8. update ja docs (#779)

    * add module getters definition explain
    
    * translate previous commit
    
    * add example of passing payload to mutation with mapMutations helper
    
    NOTE:
      pick up from 5f6b534
    
    * translate previous commit
    
    * add mouse reuse docs
    
    * translate previous commit
    
    * fix typo
    
    NOTE:
      pick up from 72107ac
    
    * translate plugins section
    
    NOTE:
      reference from 8029c39
    
    * add describe options argument of dispatch/commit in api docs
    
    NOTE:
      pick up from 1b889aa
    
    * translate previous commit
    
    * update state section
    
    NOTE:
      pick up from 7aad4a3
    
    * remove origin
    kazupon authored and yyx990803 committed May 15, 2017
    Copy the full SHA
    8a4e485 View commit details

Commits on May 20, 2017

  1. docs(ja): Fix typo (#792)

    itkrt2y authored and kazupon committed May 20, 2017
    Copy the full SHA
    77d571f View commit details
  2. Copy the full SHA
    ddcf9c2 View commit details
  3. Merge pull request #793 from zzuieliyaoli/intro-flow-png-responsive

    Fix: flow.png in intro.md isn't responsive
    blake-newman authored May 20, 2017
    Copy the full SHA
    acfe620 View commit details

Commits on May 22, 2017

  1. Doc EN getters.md : Add new line for consistency (#791)

    * Add new line for consistency into getters.md
    
    Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
    
    * Add tick for consistency accross all Vue docs.
    
    Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
    MachinisteWeb authored and ktsn committed May 22, 2017
    Copy the full SHA
    752dbc6 View commit details

Commits on May 24, 2017

  1. Copy the full SHA
    44d4a72 View commit details
  2. Copy the full SHA
    730b369 View commit details
  3. Improve documentation consistency for mutations.md and actions.md (

    …#794)
    
    * Improve documentation consistency for `mutations.md`
    
    Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
    
    * Add mapMutations to ticked text
    
    Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
    
    * Add review of actions.md to the PR
    
    Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
    
    * Add ticks to modules.md
    
    Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
    
    * Add some tick to plugins.md
    
    Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
    MachinisteWeb authored and yyx990803 committed May 24, 2017
    Copy the full SHA
    e1e4c2e View commit details
  4. Copy the full SHA
    1a37783 View commit details

Commits on May 26, 2017

  1. vuex 支持延迟生成store (#798)

    * vuex 支持延迟生成store
    
    场景:
    组件树:(R为根组件;C1为R的子组件;C11、C12为C1的子组件, C11,C12下面还有很多下层组件)
    R
    |___C1
      |____C11
      |____C12
    |___C1
      |____C11
      |____C12
    |___C1
      |____C11
      |____C12
    
    C1的每个实例的数据显示是不一样的, 如果使用props传递数据,将会导致所有组件的实例要知道自己的index,不然不知道去修改哪个state。如果vuex支持延时创建store,那么在C1 上面延时生成store,下层组件使用$store的时候,不需要关心当前是哪个store的。
    
    * Update mixin.js
    
    * 优化写法
    
    优化写法
    liusanshi authored and yyx990803 committed May 26, 2017
    Copy the full SHA
    e71a2d3 View commit details

Commits on May 28, 2017

  1. Copy the full SHA
    a090c62 View commit details

Commits on May 30, 2017

  1. Update getting-started.md (#810)

    dongwooklee9 authored and kazupon committed May 30, 2017
    Copy the full SHA
    57506ca View commit details
  2. Copy the full SHA
    11e72c6 View commit details

Commits on Jun 1, 2017

  1. Copy the full SHA
    364e8c0 View commit details
  2. Copy the full SHA
    22fbb5b View commit details

Commits on Jun 2, 2017

  1. update eslint config

    yyx990803 committed Jun 2, 2017
    Copy the full SHA
    9b47635 View commit details

Commits on Jun 6, 2017

  1. Minor language fixes. (#818)

    * Typo fix in "Mutations" section.
    
    Fixed via rephrasing slightly.
    
    * Typo fix in "Actions" section.
    
    * Typo fix in "Modules" section.
    Francisc authored and ktsn committed Jun 6, 2017
    Copy the full SHA
    82efdd0 View commit details

Commits on Jun 11, 2017

  1. Clarify getter cache behavior (#831)

    aduth authored and ktsn committed Jun 11, 2017
    Copy the full SHA
    41a5cbd View commit details

Commits on Jun 13, 2017

  1. remove usesInit condition (#824)

    - rename: init -> beforeCreate in v2.0.0-alpha.7
    - it's not necessary in the next version
    ICELI authored and yyx990803 committed Jun 13, 2017
    Copy the full SHA
    b64766b View commit details
  2. 띄어쓰기 수정 (#832)

    상 태 -> 상태
    juhwan1004 authored and kazupon committed Jun 13, 2017
    Copy the full SHA
    08e43c7 View commit details

Commits on Jun 16, 2017

  1. Webpack to webpack (#835)

    chalkpe authored and kazupon committed Jun 16, 2017
    Copy the full SHA
    02e7703 View commit details
  2. Change Webpack to webpack (#820)

    Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
    MachinisteWeb authored and kazupon committed Jun 16, 2017
    Copy the full SHA
    31772f0 View commit details

Commits on Jun 30, 2017

  1. fix typo (#848)

    meganetaaan authored and kazupon committed Jun 30, 2017
    Copy the full SHA
    c2aed43 View commit details

Commits on Jul 1, 2017

  1. Update testing.md (#844)

    Alex-Sokolov authored and ktsn committed Jul 1, 2017
    Copy the full SHA
    582a355 View commit details

Commits on Jul 4, 2017

  1. Update mutations.md (#851)

    * Update mutations.md
    
    small correction
    
    * Update mutations.md
    TokaLazy authored and posva committed Jul 4, 2017
    Copy the full SHA
    bcafd87 View commit details

Commits on Jul 8, 2017

  1. Copy the full SHA
    0cee68b View commit details

Commits on Jul 12, 2017

  1. [RU] Updates (#859)

    * russian docs translation started
    
    * docs/ru/actions.md translated
    
    * docs/ru/api.md translated
    
    * docs/ru/forms.md translated
    
    * api translation fix
    
    * docs/ru/getters.md translated
    
    * docs/ru/getting-started.md translated
    
    * docs/ru/hot-reload.md translated
    
    * docs/ru/installation.md translated
    
    * docs/ru/intro.md translated
    
    * docs/ru/modules.md translated
    
    * docs/ru/README.md translated
    
    * docs/ru/strict.md translated
    
    * docs/ru/structure.md translated
    
    * docs/ru/SUMMARY.md translated (O_O for some reason it happens to be exactly the same as README.md)
    
    * docs/ru/mutations.md translated
    
    * docs/ru/plugins.md translated
    
    * docs/ru/state.md translated
    
    * docs/ru/testing.md translated
    
    * docs/ru/actions.md styling/proof-reading
    
    * docs/ru/api.md styling/proof-reading
    
    * docs/ru/forms.md styling/proof-reading
    
    * docs/ru/getters.md styling/proof-reading
    
    * docs/ru/getting-started.md styling/proof-reading
    
    * docs/ru/hot-reload.md styling/proof-reading
    
    * docs/ru/installation.md styling/proof-reading
    
    * docs/ru/intro.md styling/proof-reading
    
    * docs/ru/modules.md styling/proof-reading
    
    * docs/ru/mutations.md styling/proof-reading
    
    * docs/ru/plugins.md styling/proof-reading
    
    * docs/ru/state.md styling/proof-reading
    
    * docs/ru/strict.md styling/proof-reading
    
    * docs/ru/structure.md styling/proof-reading
    
    * docs/ru/testing.md styling/proof-reading
    
    * docs/ru/intro.md typo fix
    
    * Copyediting RU documentation
    
    * Fix typo
    
    * Change wording around alternative approaches to data handling
    
    * Fix typo
    
    * Fix typo
    
    * Better wording for linters
    
    * Fix header and change wording
    
    * fix typo
    
    * typos reported by @ipelekhan are fixed
    
    * Russian docs translation update
    
    * Fix typo
    
    * Sentence rephrasing and fix punctuation
    
    * Переключил на ветку translation-ru
    
    * - Исправлен пример
    
    * - getting-started.md исправлена ссылка на jsfiddle
    
    * - getters.md добавлена секция про возможность передачи функции в геттерах
    
    * - installation.md добавлен флаг --save
    
    * - modules.md мелкая правка в примере
    
    * Update modules.md
    
    * modules.md ещё мелкая правка в примере
    
    * modules.md добавлен пример регистрации модуля
    
    #634
    
    * actions.md расширен пример
    
    * getters.md исправление
    
    * strict.md обновление и добавлено уточнение о затратности
    
    * testing.md исправлен пример конфига webpack
    
    * api.md изменены ссылки
    
    * intro.md изменена ссылка
    
    * state.md изменена ссылка
    
    * api.md добавлены уточнения при определении в модуле
    
    * mutations.md добавлено уточнение примера
    
    * modules.md обновление 2.3.0
    
    * api.md исправлена ошибка
    
    * plugins.md добавлено уточнение в пример
    
    * modules.md исправлена опечатка
    
    * api.md добавлены описания options для dispatch/commit
    
    * state.md исправлен комментарий про standalone
    
    * Перефразировано
    
    * getters.md добавлены бэктики в пример
    
    * actions.md правки
    
    * modules.md правки
    
    * mutations.md
    
    * plugins.md правки
    
    * modules.md добавлена ссылка на SSR
    
    * getters.md добавлено уточнение
    
    * testing.md добавлены -loader
    
    * actions.md инстанс -> экземпляр
    
    * api.md инстанс -> экземпляр
    
    * state.md инстанс -> экземпляр
    Alex-Sokolov authored and ktsn committed Jul 12, 2017
    Copy the full SHA
    ba8feba View commit details

Commits on Jul 14, 2017

  1. Remove src directory from npm module (#861)

    KELiON authored and ktsn committed Jul 14, 2017
    Copy the full SHA
    71084f4 View commit details

Commits on Jul 17, 2017

  1. Add MutationPayload type (#869)

    * Add MutationPayload type
    
    On the subscribe function, the mutation object was only having the `type` property and missing the payload
    
    * Add tests for MutationPayload
    alexjoverm authored and ktsn committed Jul 17, 2017
    Copy the full SHA
    fd2b188 View commit details
Showing 363 changed files with 38,687 additions and 6,180 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"presets": ["es2015", "stage-2"]
"presets": ["env"],
"plugins": ["transform-object-rest-spread"]
}
94 changes: 94 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
version: 2

defaults: &defaults
working_directory: ~/vuex
docker:
- image: circleci/node:8-browsers

jobs:
install:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-vuex-{{ .Branch }}-{{ checksum "yarn.lock" }}
- v1-vuex-{{ .Branch }}
- v1-vuex
- run:
name: Installing Dependencies
command: yarn
- save_cache:
paths:
- ./node_modules
key: v1-vuex-{{ .Branch }}-{{ checksum "yarn.lock" }}
- persist_to_workspace:
root: ~/
paths:
- vuex

lint-types:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Linting
command: |
yarn lint --format junit --output-file test-results/eslint/results.xml
- run:
name: Testing Types
command: |
yarn test:types
- store_test_results:
path: test-results
- store_artifacts:
path: test-results

test-unit:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Running Unit Tests
command: |
yarn test:unit
test-e2e:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Running End-to-end Tests
command: |
yarn test:e2e
test-ssr:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Running Server-side Rendering Tests
command: |
yarn test:ssr
workflows:
version: 2
install-and-parallel-test:
jobs:
- install
- lint-types:
requires:
- install
- test-unit:
requires:
- install
- test-e2e:
requires:
- install
- test-ssr:
requires:
- install
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"root": true,
"extends": [
"plugin:vue-libs/recommended"
]
}
8 changes: 0 additions & 8 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
node_modules
TODO.md
lib
docs/_book
docs/.vuepress/dist
examples/**/build.js
types/typings
types/test/*.js
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2016 Evan You
Copyright (c) 2015-present Evan You

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -3,10 +3,10 @@
> Centralized State Management for Vue.js.
<p align="center">
<img width="700px" src="https://raw.githubusercontent.com/vuejs/vuex/dev/docs/en/images/vuex.png">
<img width="700px" src="https://raw.githubusercontent.com/vuejs/vuex/dev/docs/.vuepress/public/vuex.png">
</p>

- [What is Vuex?](http://vuex.vuejs.org/en/intro.html)
- [What is Vuex?](https://vuex.vuejs.org/)
- [Full Documentation](http://vuex.vuejs.org/)

## Examples
18 changes: 0 additions & 18 deletions bower.json

This file was deleted.

83 changes: 83 additions & 0 deletions build/build.main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
const fs = require('fs')
const path = require('path')
const zlib = require('zlib')
const terser = require('terser')
const rollup = require('rollup')
const configs = require('./configs')

if (!fs.existsSync('dist')) {
fs.mkdirSync('dist')
}

build(Object.keys(configs).map(key => configs[key]))

function build (builds) {
let built = 0
const total = builds.length
const next = () => {
buildEntry(builds[built]).then(() => {
built++
if (built < total) {
next()
}
}).catch(logError)
}

next()
}

function buildEntry ({ input, output }) {
const { file, banner } = output
const isProd = /min\.js$/.test(file)
return rollup.rollup(input)
.then(bundle => bundle.generate(output))
.then(({ output: [{ code }] }) => {
if (isProd) {
const minified = (banner ? banner + '\n' : '') + terser.minify(code, {
toplevel: true,
output: {
ascii_only: true
},
compress: {
pure_funcs: ['makeMap']
}
}).code
return write(file, minified, true)
} else {
return write(file, code)
}
})
}

function write (dest, code, zip) {
return new Promise((resolve, reject) => {
function report (extra) {
console.log(blue(path.relative(process.cwd(), dest)) + ' ' + getSize(code) + (extra || ''))
resolve()
}

fs.writeFile(dest, code, err => {
if (err) return reject(err)
if (zip) {
zlib.gzip(code, (err, zipped) => {
if (err) return reject(err)
report(' (gzipped: ' + getSize(zipped) + ')')
})
} else {
report()
}
})
})
}

function getSize (code) {
return (code.length / 1024).toFixed(2) + 'kb'
}

function logError (e) {
console.log(e)
}

function blue (str) {
return '\x1b[1m\x1b[34m' + str + '\x1b[39m\x1b[22m'
}
92 changes: 92 additions & 0 deletions build/configs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
const path = require('path')
const buble = require('rollup-plugin-buble')
const replace = require('rollup-plugin-replace')
const version = process.env.VERSION || require('../package.json').version
const banner =
`/**
* vuex v${version}
* (c) ${new Date().getFullYear()} Evan You
* @license MIT
*/`

const resolve = _path => path.resolve(__dirname, '../', _path)

const configs = {
umdDev: {
input: resolve('src/index.js'),
file: resolve('dist/vuex.js'),
format: 'umd',
env: 'development'
},
umdProd: {
input: resolve('src/index.js'),
file: resolve('dist/vuex.min.js'),
format: 'umd',
env: 'production'
},
commonjs: {
input: resolve('src/index.js'),
file: resolve('dist/vuex.common.js'),
format: 'cjs'
},
esm: {
input: resolve('src/index.esm.js'),
file: resolve('dist/vuex.esm.js'),
format: 'es'
},
'esm-browser-dev': {
input: resolve('src/index.esm.js'),
file: resolve('dist/vuex.esm.browser.js'),
format: 'es',
env: 'development',
transpile: false
},
'esm-browser-prod': {
input: resolve('src/index.esm.js'),
file: resolve('dist/vuex.esm.browser.min.js'),
format: 'es',
env: 'production',
transpile: false
}
}

function genConfig (opts) {
const config = {
input: {
input: opts.input,
plugins: [
replace({
__VERSION__: version
})
]
},
output: {
banner,
file: opts.file,
format: opts.format,
name: 'Vuex'
}
}

if (opts.env) {
config.input.plugins.unshift(replace({
'process.env.NODE_ENV': JSON.stringify(opts.env)
}))
}

if (opts.transpile !== false) {
config.input.plugins.push(buble())
}

return config
}

function mapValues (obj, fn) {
const res = {}
Object.keys(obj).forEach(key => {
res[key] = fn(obj[key], key)
})
return res
}

module.exports = mapValues(configs, genConfig)
20 changes: 0 additions & 20 deletions build/rollup.config.js

This file was deleted.

3 changes: 3 additions & 0 deletions build/rollup.dev.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { input, output } = require('./configs').commonjs

module.exports = Object.assign({}, input, { output })
10 changes: 6 additions & 4 deletions build/rollup.logger.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const buble = require('rollup-plugin-buble')

module.exports = {
entry: 'src/plugins/logger.js',
dest: 'dist/logger.js',
format: 'umd',
moduleName: 'createVuexLogger',
input: 'src/plugins/logger.js',
output: {
file: 'dist/logger.js',
format: 'umd',
name: 'createVuexLogger',
},
plugins: [buble()]
}
5 changes: 0 additions & 5 deletions circle.yml

This file was deleted.

2 changes: 1 addition & 1 deletion dist/logger.d.ts
Original file line number Diff line number Diff line change
@@ -12,4 +12,4 @@ export interface LoggerOption<S> {
mutationTransformer?: <P extends Payload>(mutation: P) => any;
}

export default function createLogger<S>(option: LoggerOption<S>): Plugin<S>;
export default function createLogger<S>(option?: LoggerOption<S>): Plugin<S>;
Loading