Skip to content

Commit b821681

Browse files
committed
fix esm build exports
1 parent ab2de10 commit b821681

File tree

6 files changed

+452
-432
lines changed

6 files changed

+452
-432
lines changed

build/dev-entry.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const replace = require('rollup-plugin-replace')
33
const version = process.env.VERSION || require('../package.json').version
44

55
module.exports = {
6-
entry: 'src/index.js',
6+
entry: process.env.ESM ? 'src/index.esm.js' : 'src/index.js',
77
dest: process.env.ESM ? 'dist/vuex.esm.js' : 'dist/vuex.js',
88
format: process.env.ESM ? 'es' : 'umd',
99
moduleName: 'Vuex',

examples/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232

3333
resolve: {
3434
alias: {
35-
vuex: path.resolve(__dirname, '../build/dev-entry')
35+
vuex: path.resolve(__dirname, '../src/index.esm.js')
3636
}
3737
},
3838

src/index.esm.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Store, install } from './store'
2+
import { mapState, mapMutations, mapGetters, mapActions } from './helpers'
3+
4+
export default {
5+
Store,
6+
install,
7+
version: '__VERSION__',
8+
mapState,
9+
mapMutations,
10+
mapGetters,
11+
mapActions
12+
}
13+
14+
export {
15+
Store,
16+
mapState,
17+
mapMutations,
18+
mapGetters,
19+
mapActions
20+
}

0 commit comments

Comments
 (0)